How to uninstall packages from Linux?

In this article, we will learn to uninstall the different types of packages from Linux.

Let’s understand the uninstalling process through some examples:

Example 1: Uninstall a package using apt-get

In this example, we will remove GIMP, a graphics software that was installed with the help of apt-get. 

Step 1: To list all the apt-get packages, enter the following command in Terminal:

dpkg --list

As you can see, gimp is installed in the output

 

Step 2: Now run the following command to uninstall any package. Here the package is GIMP.

sudo apt-get --purge remove gimp

The output is as follows:

 

Example 2: Uninstall the SNAP package

Snap packages are very popular, and in this example, we again have GIMP as a snap package to uninstall. 

Step 1: Run the following command to check the exact name

snap list

The gimp software is highlighted in the output

 

Step 2: Run the following command to remove it.

sudo snap remove gimp

The output is as follows:

 

Example 3: Using autoremove command

We will uninstall the GIMP software as an apt-get package. We may not always want to uninstall the configuration file. 

Step 1: So run the following command to remove it.

sudo apt-get remove gimp

The output is as follows:

 

Step 2: And then if you want to remove unnecessary packages that were required for gimp exclusively to be not present, then run the following command.

sudo apt-get autoremove

The output is as follows

 

Step 3: Finally, run the following command so that everything is fine

sudo apt-get clean

This doesn’t have any output but is affected internally for the apt repository.


Contact Us