4

I noticed a weird thing in my /etc/init.d files and tried to look a bit what was going on.

Here's my problem:

 # apt-file search /etc/init.d/minissdpd 
minissdpd: /etc/init.d/minissdpd

 # dpkg-query -L minissdpd
/etc
/etc/default
/etc/default/minissdpd
/etc/init.d
/etc/init.d/minissdpd

 # apt-get remove minissdpd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'minissdpd' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 177 not upgraded.

How comes there are files from minissdpd yet it says minissdpd isn't installed?

Can I safely delete those?

3

dpkg -P package should purge the package entirely including configuration files. Following is the description of the option from man dpkg command

-r, --remove, -P, --purge package...|-a|--pending Remove an installed package. -r or --remove remove everything except conffiles. This may avoid having to reconfigure the pack age if it is reinstalled later. (Conffiles are configuration files that are listed in the DEBIAN/conffiles control file). -P or --purge removes everything, including conffiles. If -a or --pending is given instead of a package name, then all packages unpacked, but marked to be removed or purged in file /var/lib/dpkg/status, are removed or purged, respectively. Note: some configuration files might be unknown to dpkg because they are created and handled separately through the configuration scripts. In that case, dpkg won't remove them by itself, but the package's postrm script (which is called by dpkg), has to take care of their removal during purge. Of course, this only applies to files in system directories, not configuration files written to individual users' home directories.

2

If you use the remove command (dpkg -r, apt-get remove, …), then the package is uninstalled and most of the package files are removed. However the configuration files are left behind. This is done because configuration files use up very little disk space and may contain local modifications. This way the local modifications are kept around and will take effect again if you reinstall the package.

If you don't want to leave these packages behind, use the purge command (dpkg -P, apt-get purge, …).

An easy way to list packages that are removed but have configuration files left behind is

dpkg -l | grep \^rc

The variant dpkg -l | grep -v '^ii' lists all packages that aren't absent or fully installed. This includes removed-but-not-purged packages as well as packages whose installation or removal was interrupted.

With aptitude, you can list removed-but-not-purged packages with

aptitude search '~c'
0

How comes there are files from minissdpd yet it says minissdpd isn't installed?

You didn't use the --purge flag, so dpkg doesn't bother to clean up residual data that the package created since it was not instructed to do so.

If you want to completely remove a package and all of its data/config files, then you should use apt-get remove --purge <PACKAGE>, see the manual page for more information.

  • ... or apt-get purge <PACKAGE> for short. – n.st Jan 3 '14 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.