How to Uninstall Programs from your Ubuntu System
This article describes removing software from your Ubuntu system that you do not need anymore. We are describing software removal both through the graphical user interface (Ubuntu Software Manager) and the command line-the (Terminal).
Please note that you need administrative privileges to install/uninstall any software from Ubuntu.
We have run and tested the commands and procedures mentioned in this article on Ubuntu 22.04 and Ubuntu 20.04.
Mục lục bài viết
Uninstall Applications Through Ubuntu Software Manager
One way to uninstall software from your computer is through the Ubuntu Software Manager. Click on the Ubuntu Software icon in the Activities toolbar; this will open the Ubuntu Software manager through which you can search for, install and uninstall software from your computer.
Then click the Installed tab from the following view to list all the applications installed on your Ubuntu system:
From the list of applications, look up the one you want to uninstall and then click the Remove button against it.
In this example, I am removing software called XCFA from my system by clicking the Remove button against it. When you try to remove an application, the following type of confirmation message appears:
Click the Remove button when you are sure that you want to remove the selected application. When you do so, the following authentication dialog will appear as only an authorized user can remove an application from Ubuntu:
Enter the password for an Administrator or a sudo user, and then click the Authenticate button.
The selected software will now be removed from your system.
Uninstall Applications Through the Command Line
You can remove installed software from your system through apt-get remove and apt-get purge commands as sudo. But first, you need to know the exact package name through which you installed the software.
The following command will list all the packages installed on your system:
$ dpkg --list
You may want to copy the exact package name, select it, right-click, and then copy it from the dpkg list for further use.
Use apt-get remove command
The apt-get remove command removes software from your system but keeps the configuration files and any plugins and settings you might have installed later. This helps keep the same settings when you want to reinstall the software.
Run the following command as sudo to remove the software;
$ sudo apt-get remove package-name
You will be asked for the password for sudo and given the information about what will be removed from your system.
In this example, I will remove the OpenJDK package named “openjdk-11-jdk” from my system.
The system will also prompt with a y/n option to re-confirm the uninstall procedure. When you click Y, the process will begin, and the software will be removed from your system.
Use apt-get purge command
If you want to remove an application altogether from your system, also removing any personalized settings, it is best to use the apt-get purge command.
In this example, I will remove the OpenJDK package named “openjdk-11-jdk:amd64” from my system.
Run the following command as sudo to remove the software;
$ sudo apt-get purge package-name
You will be asked for the password for sudo and given the information about what will be removed from your system.
The system will also prompt with a y/n option to re-confirm the uninstall procedure. When you click Y, the process will begin and the software will be removed from your system.
Bonus: Cleanup the Mess with autoremove
In case you want to remove any dependencies, such as the applications and libraries used by the software you once installed that is no longer in use, you can do some housekeeping through the following command:
$ sudo apt-get autoremove
This will list all the obsolete and unused packaged and leftover dependencies taking up important space on your system.
The apt package manager will also prompt you to confirm the uninstall process again. When you click Y, the process begins, and the unwanted software dependencies are removed from your system.
You have learned that there are two ways to uninstall the software from your Ubuntu system: via the Ubuntu Software Manager and via the command line. From the command line, you can remove the software and keep all configuration files (apt-get remove) or remove the software altogether (apt-get purge).