Computer

Remove all leftovers when uninstalling programs on Linux

It is true that, regarding the management of programs and files, Linux is superior to Windows. Without going any further, this operating system does not have the chaotic record that, at the slightest failure, can leave our entire system useless. In addition, Linux developers tend to take special care when creating installation and deletion routines for their programs, so these remains often disappear. But it’s not always like this.

Depending on the distribution we use, and the package manager, the way to clean our system can be one way or another. Next we will see how to do it in each of the cases.

Clean up Linux program leftovers with APT

APT-GET, or better known as APT, is the most used package manager within the Linux ecosystem. This is the default package manager for Debian, and for most distros based on it, such as Ubuntu or Linux Mint.

If we have installed a program using APT, the best way to uninstall it is to use APT anyway. To do this, all we have to do is open a terminal console and execute the following command in it:

sudo apt purge paquete

For instance:

sudo apt purge firefox

By using the “purge” parameter, APT will look for all leftovers, dependencies that were downloaded and installed when the program was installed, and any configurations that the program may have created. We will be able to see a list with everything that has been marked for deletion and, if it is correct, just press the «Y» key to confirm and process the uninstallation of the program.

LInux Purge Rhythmbox

When finished, the application (Firefox, in this example) and all the program data will be gone. But if we want to eliminate any possible trace that may have remained (for example, an orphan dependency) we can do so by executing, after the above, the following command:

sudo apt-get autoremove

Remove junk files from programs with YUM

Yum it is one of the most used alternatives to APT. This is usually the default package manager used on RPM-based Linux systems, such as Fedora. The operation of YUM is very similar to that of APT, and it is that to delete a program using this package manager, with its remains, it will be enough to execute the following command in a terminal:

sudo yum remove paquete1 paquete2

As we can see, we can add several packages at the same time to be uninstalled one after the other, which helps us avoid having to execute the same command over and over again if we don’t need it. If we only want to delete a program (Firefox, for example) it will be enough to execute it as follows:

sudo yum remove firefox

The YUM package manager will take care of this task. When the operation is finished, the browser, and all the files related to it, will have disappeared from our computer.

Clear app traces with Pacman

Another well-known and widely used package manager, especially on Arch Linux systems, is Pacman. This package manager is, broadly speaking, another alternative to ATP or YUM, with its own characteristics and its own commands and parameters.

This command is somewhat different from the previous ones, in that its parameters are entered in a row, one after the other, instead of being a word. For example, the parameter to delete a single program (without dependencies or anything else) is -R, but if we want to eliminate these dependencies and everything that is orphaned and unnecessary, what we must do is execute:

sudo pacman -Rcns paquete

Again, we will have to change “package” by the name of the program that we want to uninstall and clean. For example, Firefox.

When you run this command, Pacman will analyze the program and look for all the dependencies and all the files and directories that have been generated by it. If we agree, it will be enough to confirm the task with the letter Y and wait for it to be completed. At the end we will be able to see a summary with all the packages that have been eliminated.

Uninstall a Linux program with Synaptic

So far we have seen different terminal package managers. But we could not forget one of the best tools to control the packages installed on our system: Synaptic. This package manager can be used graphically, and it will allow us to have much more control over what is, or is not, installed on the computer without the need to know commands.

Of course, we must bear in mind that in many distros, such as Ubuntu, this manager is not installed by default. Therefore, we will have to install it ourselves by executing the following command:

sudo apt install synaptic

Once installed, we will execute it and we will see all the installed packages, and those that are not installed but are registered by the repositories. We search the list for the program that we want to delete completely, and select the option “Mark to uninstall completely.”

Synaptic uninstall completely

Once this option is checked, Synaptic itself will mark the program, and all its dependencies, to uninstall. Click on the “Apply” button at the top and wait for the task to finish. When finished, the program, and all its traces, will have disappeared.

Linux directories where configurations and remnants of programs can be

In addition to the above, if we want, we can take advantage of it to also eliminate by hand the possible remains that may have been left on the computer. For example, configuration files, or some temporary junk files.

These can be saved in many directories (like our personal folder), in addition to the following:

  • ~ /
  • / usr / bin
  • / usr / lib
  • / usr / local
  • / usr / share / man
  • / usr / share / doc
  • / var
  • / run
  • / lib
  • ~ / .cache
  • ~ / .local
  • ~ / .local / share
  • ~ / .thumbnail
  • ~ / .config /

This process is already much more manual than the previous ones, so we must know what we are doing and not delete everything we want. Or else we may have problems.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *