How to Uninstall a Package on Ubuntu

This quick guide will show you how to uninstall a package on the Ubuntu operating system.

Ubuntu uninstall Packages

You can uninstall a package from Ubuntu in a couple of ways. Utilizing the terminal is the first and most prominent way to remove packages.

Packages can easily be uninstalled by using the apt package manager. As long as you know the name of a package on your system, you can uninstall it by using this command.

Alternatively, if you are running Ubuntu desktop, you can uninstall select packages through a graphical interface.

Over the following two sections, we will show you how to uninstall a package on Ubuntu using either the terminal or desktop interfaces.

How to Uninstall Packages on Ubuntu Using the Terminal

Utilizing the terminal is one of the fastest and easiest ways to uninstall a package on the Ubuntu operating system.

Ubuntu utilizes the apt package manager. The package manager lets you easily install and uninstall packages installed on your system, as you will soon see.

The following sections will show you a few ways to uninstall a package using the terminal.

If you are running a desktop variant of Ubuntu, you can open the terminal by pressing CTRL + ALT + T.

Uninstalling Packages using the apt Package Manager

The apt package manager on Ubuntu allows you to very easily uninstall packages as long as you know the name of it.

Using the apt package manager’s “remove” functionality will potentially leave configuration files behind. If you need config files removed as well, you will need to use the “purge” option instead.

All you need to do is use “apt remove” followed by the package’s name, as shown in the command below. This command can also be written using “apt-get” instead of “apt“.

Whenever you attempt to remove a package, you will be asked to type in “y” to confirm the removal.

apt remove PACKAGENAME...

Example of Uninstalling a Package from Ubuntu

For example, if you wanted to uninstall the “curl” package from your system, you would use the following command within the terminal.

All you need to do is write “apt remove” followed by “curl“. We are using “sudo” as our user is not the root user.

sudo apt remove curl

Example of Uninstalling Multiple Packages

It is also possible to uninstall multiple package’s from Ubuntu by specifying each packages name one after another.

For example, you would use the command below if you wanted to remove both the “curl” and “wget” packages.

sudo apt remove curl wget

Purging a Package from Ubuntu

When using the “remove” option, Ubuntu can leave files behind while uninstalling a package. To work around this apt offers another option, the “purge” option.

The purge option removes files associated with the package you uninstalled from your Ubuntu system. Please note that apt can only remove files it knows of upon installing the package.

The purge option also works like the remove one for uninstalling packages on Ubuntu. The syntax is the same. You will just be using the “purge” keyword instead.

apt purge PACKAGENAME

Example of How to Purge a Package from Ubuntu

For example, you would utilize the below command to purge a package called “curl” from your Ubuntu system.

As you can see, we only needed use “apt purge” followed by our package name, “curl“. As our user was not the root user we had to use “sudo” before the command.

sudo apt purge curl

Uninstalling Unused Packages from your System

If you want to clean up your Ubuntu system by uninstalling unused packages, then apt offers an option called “autoremove“.

This “autoremove” option works by looking for any packages it thinks are no longer needed, as the packages that installed them originally are no longer installed.

To uninstall these unneeded packages from Ubuntu, use the following command within the terminal.

apt autoremove

Uninstalling Snap Packages

While most packages you install to Ubuntu are easily removable using the apt package manager, this isn’t always the case.

For example, if the package you are trying to uninstall on Ubuntu was installed using snap, you will need to use snap to remove it.

The syntax for this is very similar to what you used before. You need to use the keyword “snap” instead of “apt“, as shown below.

snap remove PACKAGENAME

Example of Uninstalling a Package using snap

For example, to remove the Dosbox-X snap package, you would use a command as we have written below.

All you need to do is use “snap remove” followed by the names of the packages you want to remove from Ubuntu. If you are not the root user, you must use “sudo” in front of the command.

sudo snap remove dosbox-x

Using the Ubuntu Desktop to Uninstall a Package

If you would prefer to stick to Ubuntu’s desktop interface, then there is a graphical utility that you can use to uninstall packages.

The caveat of using this method is that you can only uninstall packages that were installed with the Ubuntu Software center.

1. To open the Ubuntu Software package, you must first go to the activities screen.

The activities screen can be opened by clicking the top or bottom left of the screen.

Open activities screen

2. With the activities screen opened on your device, use the search box at the top of the screen (1.) and type in “ubuntu software“.

Once you see “Ubuntu Software” appear in the search (2.), click it to open the application.

Search for Ubuntu Software

3. With the Ubuntu Software application open, you will want to change to the “Installed” tab.

You can change to this tab by clickinginstalled” in the bar at the top of the application.

Open Installed tab

4. You will now find a list of applications and utilities installed on your Ubuntu system using this software.

To uninstall listed applications, you only need to do click the “Uninstall” button.

Click to uninstall package from Ubuntu

Conclusion

By this point in the guide, you should know how to uninstall a package on Ubuntu.

Utilizing the apt package manager is the easiest way to uninstall a package from your system. However, you can also use the Ubuntu Software application to uninstall apps you installed using that software.

Please comment below if you have had any issues with uninstalling packages off of your system.

We have many other Ubuntu guides that teach you more about using the system.

Leave a Reply

Your email address will not be published. Required fields are marked *