Given that I removed an application using apt remove
, how do I remove the configuration files later, so that I get the result of apt purge
?

- 305
- 1
- 3
- 12
4 Answers
You can use apt-get purge
for the same exact purpose, here is an example:
First remove your desired program using
apt remove
, then run:dpkg -l package-name
You should get:
||/ Name Version Architecture Description +++-=================-=============-=============-==================== rc package-name 1.1 amd64 something
RC means:
r
package has been removed.c
configuration files still lives on your system
Now use
apt-get purge
for exact same program, this timedpkg -l package-name
output should be like:||/ Name Version Architecture Description +++-=================-=============-=============-==================== un package-name <none> <none> (no description available)

- 55,668
- 25
- 164
- 183
-
2Gosh you rock, I am digging your linux skill! – George Udosen Jul 17 '17 at 15:30
-
1I have definitely learnt something today :) – George Udosen Jul 17 '17 at 15:32
The location of the configuration files of an application varies from application to application, and sometimes it is time-consuming to find them. Even if an application has been removed, you can run sudo apt purge <package_name>
to purge its configuration files.

- 114,770
The commands to remove/purge the packages have already been provided in other answers.
There are some discrepancies that can call some confusion, and leave some of the application's folders. If there are foreign files or directories in the applications configuration folders, it may not delete the folder, just the configuration files that it uses.
So the actual configuration files/settings will be removed.
The process should be followed the autoremove
command.
This example will perform the task:
In the steps, I install a sample package that will include lots of configuration files. Then the commands that follow will remove the application and all its configuration files including the /etc/apache2
directory.
If you install libapache2-mod-php
after installing apache2
, the folders with the Php files will remain with the PHP configuration. If you don't install something that uses the shared folder, the folder will also be removed.
$ sudo apt install apache2
$ sudo apt purge apache2
$ sudo apt --purge autoremove
Note:
You can pick a different package to test the understanding of what happens with the install folders. The behavior will be the same for the actual application that you want to remove along with its configuration files and settings.

- 25,036
-
Or
sudo apt --purge autoremove
to delete the dependencies' conffiles too. – Eliah Kagan Jul 17 '17 at 16:05 -
This is really simple and straight forward. I do it all the time. Just make sure to change the program name to the one you want to remove.
sudo apt-get --purge remove firefox
Then you want to remove all dependencies that were installed with your program; you no longer need them.
When removing has finished, continue:
sudo apt-get autoremove
Now everything to do with that program, is completely removed and uninstalled. No traces. If you installed a repository/ies, you can remove it/them by going to:
System Settings >> Software & Updates >> Other Software
On this page, you can click one-by-one, all the repositories you aren't using and click the "Remove" button beneath the box.
I hope this helps. This is what I do and it works as it should.
EDIT: if you want to do the first two steps in one line:
sudo apt-get --purge remove firefox && sudo apt-get autoremove

- 100
-
Or
sudo apt --purge autoremove
to also remove eventual configuration data for the packages you autoremove. – Soren A Jul 20 '17 at 08:58 -
So, there's need to do
-- purge remove
then doapt autoremove
?--purge autoremove
will do both? – Captain Fudge Jul 20 '17 at 10:47 -
sudo apt remove --purge package
removes package, thensudo apt autoremove --purge
removes packages that has been installed automatically as dependencies, but unreferenced now. autoremove alone wont do anything. – Soren A Jul 20 '17 at 11:06