How do I uninstall a package in Ubuntu? – Linux Hint

While working in the Linux environment, you found most of the applications or packages useful in solving your problems, but after trying these applications, you want to uninstall these packages from your system. It is an easier way to uninstall packages using the graphical interface. However, you should have basic knowledge of how to uninstall or remove a package from a Linux system by using the command-line method.

In this tutorial, we will talk about how to uninstall a package in Ubuntu distribution using both methods: either using the GUI or using the command line environment.

prerequisites

To uninstall or remove an Ubuntu Linux system package

, you must have root privileges to run terminal commands

. Methods to uninstall a package on Ubuntu 20.04 system

Using the following two ways, you can uninstall an Ubuntu 20.04 operating system

package: Uninstall an Ubuntu package using Terminal (command line method) Uninstall

  1. an Ubuntu
  2. package using

  3. the GUI

Method 1: Uninstall a package using Terminal (command line method)

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 provides more control and options for uninstalling packages.

List of installed Ubuntu packages

You need to know the exact package name to uninstall a software or package from your Ubuntu system. Thus, on Ubuntu 20.04 system, you can view the installed packages using the following command:

The above command displays the large list of packages installed

on your system. However, it would be difficult to find the exact name of the package from the list of installed packages displayed. To view the output in the most readable form

, use the ‘minus’ with the above command as follows:

Press enter to move to the

next package.

You can also search for the exact package name from the entire list using the grep command as follows

:

For example, to find all packages ‘apache2’, use the command mentioned below:

Commands to remove a package using

Terminal in

Ubuntu

The following four most commonly used commands that help you

remove a software package or application from the Ubuntu system: Uninstall a package using the ‘delete’ 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 the ‘zip’ and ‘wget’ packages from the Ubuntu system. Use the command mentioned below 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 on your system. However, to completely uninstall a package that includes all configuration files, use ‘purge’ instead of running the ‘remove’ command. The following ‘purge’ command is used to uninstall an Ubuntu system package completely

:

For example, to uninstall apache2 packages along with all configuration files on your system, use the following command:

Uninstall unused packages When you install an application on Ubuntu, you can also download and install the dependencies required to install the application successfully. When you uninstall the required packages, the package dependencies still remain on the system, but are not used. These leftover or unused packages can be removed from the Ubuntu system by running the following

command:

<img src

=”https://linuxhint.com/wp-content/uploads/2021/11/uninstall-package-Ubuntu-06-1.png” alt=”” />

You can also clean the outdated/old packages from the cache by running the command mentioned below:

Uninstall snap packages The snap package manager is part of the new versions of Ubuntu. Therefore, when you independently uninstall a package using snap, you need a list of all installed snap packages. Using

the following command, you can easily display the list of all installed snap packages:

Once you have obtained the list of installed snap packages, use the following command to uninstall the snap package:

For example, to uninstall the ‘discord’ application from the list of settings, use the following command:

Method 2: Uninstall an Ubuntu package using the GUI The alternative way to uninstall a package

is to use the Ubuntu Software Center. The software package manager is available on the left sidebar of your Ubuntu desktop. To access this application, click on the ‘Ubuntu software’ icon or launch it using the application search bar as follows:

The following Ubuntu software manager window is displayed on your system. Click on the ‘Installed’ tab to view all installed packages. Here, you can search for an application that you want to uninstall from your Ubuntu system.

<img

src=”https://linuxhint.com/wp-content/uploads/2021/11/uninstall-package-Ubuntu-10.png” alt=”” />

Select the application you want to remove from your Ubuntu machine as follows:

Conclusion

We learned different commands through which you can easily uninstall a package or software from your Ubuntu 20.04 system. In addition, we also demonstrate how to remove or uninstall a package using the Ubuntu Software Center GUI. You can take any method from uninstalling a package via the command line or using the GUI; these methods are useful for all Linux users.