0

I noticed that apt-get purge doesn't always clean every trace of an installation.

As a concrete example, I'm trying to remove mailman (installed by apt-get install mailman). Now, I tried to remove every(!) trace of this installation by apt-get purge mailman.

find / -name '*mailman*' reveals that there is still some stuff from mailman around:

/run/mailman
/var/cache/apt/archives/mailman_1%3a2.1.16-2_amd64.deb
/var/spool/postfix/private/mailman
/usr/share/bash-completion/completions/mailmanctl
/usr/share/locale-langpack/en_GB/LC_MESSAGES/mailman.mo
/usr/share/locale-langpack/en_AU/LC_MESSAGES/mailman.mo

Also, the installation created an additional user "list" and a group "list" that I'm quite sure wasn't there before.

So, I was wondering how thorough apt-get purge is? In other words, in what way might apt-get install X; apt-get purge X; change my system? And are there more thorough methods?

Peter
  • 401
  • 1
  • 5
  • 17

2 Answers2

1

When building a package, the files generated by the build process are registered. When you uninstall a package, these files will be removed (remove keeps config files, purge removes them, too).

If a program itself generates files, the package manager usually doesn't know about this, and won't touch these files.

Also, third party addons, suggested packages or dependencies may create files which do not belong to the removed/purged package, even if they don't make any sense without it.

To find out to which package a file belongs, use apt-file:

apt-file search /path/to/file

You may need to install apt-file and update its database:

sudo apt-get install apt-file && sudo apt-file update
lxg
  • 12,375
  • 12
  • 51
  • 73
0

You can use

apt-get --purge remove PACKAGE instead of apt-get purge

apt-get --purge remove mailman

AND this will remove the dependencies

sudo apt-get autoremove mailman
Mubo
  • 1,078
  • 8
  • 16