[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-get: how to remove old config files?

On (02/10/05 17:37), Stefan Salewski wrote:
> Hello,
> to remove a package completely I have to use something like
> apt-get --purge remove packet.
> If I forget option purge, config-files are not removed.
> If I try 
> apt-get --purge remove packet
> after
> apt-get remove packet
> to correct my mistake apt-get complaints because
> packet is not installed.
> To remove old config files reinstallation of the packed
> and subsequent removing with option --purge should work.
> Is there a better way?
> I ask because during my first debian-testing installation (two
> years ago) dhcp-client was installed automatically instead of
> dhcp3-client. I fixed that at that time manually by removing
> dhcp-client and installing dhcp3-client. But I think I forgot to
> use --purge at that time, so some old config-files exists.

What I normally do is:

$ dpkg -l | grep ^c

which lists packages with left over configuration files and then do 

$ sudo aptitude purge <packages>

which gets rid of most of the cruft.  However, if some conf files aren't
empty they may not be removed.  So then do:

$sudo updatedb

and then something like:

$ locate <package-name> | grep conf

and then manually delete the files.

My scripting experience is pretty limited and I'm sure there is a more
elegant solution ..... but it works for me ;)



www.clivemenzies.co.uk ...
...strategies for business

Reply to: