Whenever you uninstall or remove a program/package in Ubuntu, only the binaries are removed but some of the related configuration files remain in your system. They can be anywhere in /etc or as a hidden file/folder in your home directory.

At certain time and situation you might need to completely remove both the binaries and settings. There are 2 methods to do this in Ubuntu

Synaptic Package Manager (GUI)

Run Synaptic by clicking on the System → Administration → Synaptic Package Manager menu

In Synaptic, search for the program that you want to remove. You can do it by browsing by the categories, or just type the name of the program in the search box. Installed program is marked green.

Once you've found the program, right-click on it or left click on the green icon and select the Mark for Complete Removal.

The program will be marked red. You can search for other programs to uninstall, and click on the Apply button once done.

You'll be prompted with summary of the actions Synaptic is going to take. Click on the Apply button if you agree with the proposed changes.

You'll get this confirmation window once the uninstallation is complete.

Command line

To completely remove programs using the command line, you have the following options;

→Completely remove package foo using dpkg

sudo dpkg -P foo

→Remove package foo and config files, but not dependences using apt-get

sudo apt-get --purge remove foo

→Remove unused dependencies and config files using apt-get

sudo apt-get --purge autoremove

→Remove package and unused dependencies of foo, and config files using aptitude

sudo aptitude purge foo

Guide compatibility:

Operating System
Ubuntu 16.04 LTS (Xenial Xerus)
Ubuntu 16.10 (Yakkety Yak)
Ubuntu 17.04 (Zesty Zapus)
Ubuntu 17.10 (Artful Aardvark)
Ubuntu 18.04 LTS (Bionic Beaver)
Ubuntu 18.10 (Cosmic Cuttlefish)
Ubuntu 19.04 (Disco Dingo)
Discuss the article:

Comment anonymously. Login not required.