Chat Zalo Chat Messenger Phone Number Đăng nhập
How do I uninstall a package in Ubuntu? - Linux Hint

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:

uninstall package Ubuntu 01 1

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. uninstall package Ubuntu 02 1

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:

<img src

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

alt=”” />

Commands to delete a package using

Terminal on

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 ‘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 the ‘zip’ and ‘wget’ packages from the Ubuntu system. Use the command mentioned below to uninstall these packages:

uninstall package Ubuntu 04 1

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 from your system, use the following command:

uninstall package Ubuntu 05 1

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

:

uninstall package Ubuntu 06 1

You can also clean 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:

uninstall package Ubuntu 07 1

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 by using 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:

uninstall package Ubuntu 09

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.

uninstall package Ubuntu 10

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

<img src

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

alt=”” />

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.

Contact US