In this tutorial, we will talk about how you uninstall a package in Ubuntu distribution using both methods: either using the GUI or by using the command-line environment.
To uninstall or remove a package from the Ubuntu Linux system, you must have root privileges to run the terminal commands.
Using the following two ways, you can uninstall a package from the Ubuntu 20.04 operating system:
Most Ubuntu Linux users prefer to use the command-line method to uninstall or remove an application from the Ubuntu system. The command-line method offers more control and options for uninstalling the packages.
It is necessary to know the exact package name to uninstall a software or package from your Ubuntu system. Therefore, in Ubuntu 20.04 system, you can view the installed packages by using the following command:
The above command displays the large list of installed packages on your system. but, it would be difficult to find the exact package name from the displayed, installed packages list. To view output in the more readable form, use the ‘less’ with the above command as follows:
Press enter to move on to the next package.
You can also search the exact package name from the whole list by using the grep command as follows:
For example, to find all ‘apache2’ packages, use the below-mentioned command:
The following four most commonly used commands that help you to remove a software package or an application from the Ubuntu system:
Uninstall a package using the ‘remove’ command
To uninstall or remove a package from the Ubuntu system, use the ‘apt-get remove’ command followed by the package name as follows:
You can also remove more than one package at the same time by using the following command syntax:
For example, we want to uninstall ‘zip’ and ‘wget’ packages from the Ubuntu system. Use the below-mentioned command to uninstall these packages:
Uninstall package using ‘purge’ command
The ‘apt-get remove’ command removes the entire package from your Ubuntu system. But, it leaves some packages and configuration files behind on your system. However, to completely uninstall a package including all configuration files, use the ‘purge’ instead of executing the ‘remove’ command. The following ‘purge’ command is used to uninstall a package from the Ubuntu system completely:
For example, to uninstall apache2 packages along with all configuration files from your system, use the below command:
Uninstall unused packages
When you install an application on Ubuntu, it may also download and install the dependencies required to install the application properly. When you uninstall the required packages, the packages dependencies still linger in your system but are unused. These leftover or unused packages can remove from the Ubuntu system by executing the following command:
You can also clean the outdated/ old packages from the cache by running the below-mentioned command:
Uninstall snap packages
The snap package manager is a part of the new Ubuntu versions. So, when you independently uninstall a package using snap, you need a list of all installed snap packages. Using the below-given command, you can easily display the list of all installed snap packages:
Once the installed snap packages list is obtained, use the following command to uninstall the snap package:
For example, to uninstall the ‘discord’ application from the snap list, use the following command:
The alternative way to uninstall a package is using the Ubuntu software center. The software package manager is available on the left sidebar of your Ubuntu desktop. To access this application click the ‘Ubuntu software’ icon or launch it using the application search bar as follows:
The following Ubuntu software manager window shows on your system. Click on the ‘Installed’ tab to see all installed packages. Here, you can search for an application that you want to uninstall from your Ubuntu system.
Select the application that you want to remove from your Ubuntu machine as follows:
We learned different commands through which you can easily uninstall a package or software from your Ubuntu 20.04 system. Moreover, we also demonstrated how to remove or uninstall a package using the GUI of the Ubuntu software center. You can adopt any method from either uninstalling a package via command-line or using the GUI; these methods are useful for every Linux user.
Welcome to the Ubuntu Weekly Newsletter, Issue 866 for the week of November 10 –…
Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide…
In this article, we will see how to Install Google Cloud BigQuery Python client library…
Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…
MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…
Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…