Original Whithams method of derivation of modulation equations is applied to systems whose dynamics is described by a perturbed Korteweg-de Vries equation. Two situations are distinguished: (i) the perturbation leads to appearance of right-hand sides in the modulation equations so that they become non-uniform; (ii) the perturbation leads to modification of the matrix of Whitham velocities. General form of Whitham modulation equations is obtained for each case. The essential difference between them is illustrated by an example of so-called `generalized Korteweg-de Vries equation. Method of finding steady-state solutions of perturbed Whitham equations in the case of dissipative perturbations is considered.