Categories: Ubuntu

How to Uninstall a Package on Ubuntu 22.04

Sometimes we have to uninstall the packages from Ubuntu either they are of no more use to us, or we have to free the space for installing some new applications. As we know, Ubuntu can be managed easily through the command line interface by using different commands, so we can manage the applications by using the different commands. In this blog, we are going to learn the methods by which we can uninstall the packages on Ubuntu.

How to uninstall a package on Ubuntu

To install, update, or uninstall the packages on Ubuntu, we use the APT package manager, so there are different options that are used to uninstall the packages on Ubuntu. These options are listed down:

Option 1: Uninstall a package on Ubuntu using the remove command

We can use the “remove” command to uninstall the package on Ubuntu, but this option of the apt package manager will only delete the package without deleting its configuration files.

For example, we will use this option to remove the package of Vim:

$ sudo apt remove vim -y

You can delete any package on Ubuntu by replacing the “vim” with the name of the particular package in the above command.

Option 2: Uninstall a package on Ubuntu using the auto-remove command

Another option that is used with the apt package manager is “auto-remove” and using this option we can remove the configuration files and packages which are of no more use for a long time, and use this command:

$ sudo apt auto-remove -y

Option 3: Uninstall a package on Ubuntu using the purge command

There is an option used mostly with the apt package manager is of “Purge” which not only removes the package but also all the configuration files associated with that specific package.

For example, we will again uninstall the Vim package using the command:

Sponsored
$ sudo apt purge vim -y

Option 4: Uninstall a package on Ubuntu using the dpkg command

Other than the apt package manager, we also have a dpkg manager that is also used to manage the packages on Ubuntu, especially the Debian packages, so we can also uninstall any package using the dpkg with its “-r” option.

For example, we want to uninstall the vlc media player using the command:

$ sudo dpkg -r vlc

Option 5: Uninstall a package on Ubuntu using the snapd utility

In the latest version of Ubuntu which is the Jammy Jellyfish, the snap utility is being installed by default which is used to install packages from the snapcraft store. The packages that are downloaded and installed using the snapd utility can only be uninstalled by using the snap utility.

For example, we will uninstall the rocketchat-server using the snap command:

$ sudo snap remove rocketchat-server

Conclusion

To free up the space on Ubuntu so that new packages can be installed as well as the other programs can be run smoothly, we have to uninstall the packages which are of no use. In this write-up, different techniques are being explored using which we can uninstall the packages on Ubuntu.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

1 hour ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

1 day ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago