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

How is Livepatch safeguarded against bad actors?

Canonical Livepatch is a security patching automation tool which supports reboot-less security updates for the…

3 hours ago

Accelerating data science with Apache Spark and GPUs

Apache Spark has always been very well known for distributing computation among multiple nodes using…

3 hours ago

Cut data center energy costs with bare metal automation

Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…

1 day ago

Build the future of *craft: announcing Starcraft Bounties!

Our commitment to building a thriving open source community is stronger than ever. We believe…

1 day ago

NodeJS 18 LTS EOL extended from April 2025 to May 2032 on Ubuntu

The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…

1 day ago

Native integration now available for Pure Storage and Canonical LXD

June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…

2 days ago