Can I purge configuration files after I've removed the package?

Here is a simple command that will meet your request:

dpkg --purge $(dpkg --get-selections | grep deinstall | cut -f1)

Yes you can.

From the command line:

sudo apt-get remove --purge packagename

This will remove all of the remaining files that the package installed.


You can also do this from a GUI:

  • Install Synaptic Install Synaptic from the Software Center
  • Run Synaptic
  • Find packages listed under "Not Installed (residual config)"
    Packages with residual configs
  • Right click the package and click, mark for complete removal Menu
  • Click the check button on the tool bar and click apply when the dialogue pops up. Dialogue

You can purge all previously uninstalled packages with aptitude:

aptitude purge ?config-files

You can also purge individual packages but then you would also have to purge the dependencies one by one. It is not practical.