Uninstall Packages in Linux

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

A package file in Linux distributions is an archive that contains every single file required for the package to operate properly. There is a potential that some unneeded files will download while the package is being downloaded. These unnecessary files can hamper the performance of your applications. There are numerous Linux distros where you will find different package managers to uninstall unwanted packages. In this article, I will cover 10 reliable methods to uninstall packages in Linux for Debian-based and Red-hat-based distros. Here, you will also get GUI-based uninstallation strategies. Stay connected.

6 Methods to Uninstall Packages For Debian-based Linux Derivatives

Debian-based derivatives such as Ubuntu, Linux Mint, Kali Linux, etc have different package managers for managing packages. apt, apt-get, alien, dpkg, and snap are the most popular of them. Here, I’ll walk you through the step-by-step process of these methods you can rely on to uninstall your undesired packages. Keep reading.

You can read our Comparative Analysis of Debian-based Methods to distinguish between these methods and best pick one for your need.

Method 01: Using the “apt” Command to Uninstall Packages

To uninstall any items, Ubuntu provides the apt (advanced package tool) to handle packages. In Linux, there are distinct types of packages. Some package files are based on Red Hat, while others are based on Debian. Here, I’ll demonstrate how to remove a rpm package file using the apt command. Now carefully perform the following steps to uninstall the rpm package:

Steps to Follow >

➊ First, check the location of the rpm package file you want to uninstall.

location of rpm package file of vlc software

To demonstrate the process, I have downloaded a .rpm file for the vlc software that will later be uninstalled. If you follow all the steps as instructed, you can uninstall any rpm package file you desire.

➋ Now open the Ubuntu terminal.

➌ Write the following command to convert the rpm package file to a Debian package file:

sudo alien -d vlc-3.0.19-0.4.fc39.x86_64.rpm
EXPLANATION
  • sudo: Permits administrative privileges.
  • alien: Converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats.
  • -d: The command option converts the rpm file to a Debian file format.
  • vlc-3.0.19-0.4.fc39.x86_64.rpm: rpm package file of vlc software.

rpm file format of vlc is converting to a deb file format

Now, the Debian file of vlc is ready to uninstall.

deb file of vlc is created in Downloads folder

In this image, you can see the .deb file of vlc package.

➍ After that, write this command to remove the vlc package:

sudo apt remove vlc
EXPLANATION
  • apt: Provides a high-level command line interface for the package management system.
  • remove: Command removes a package.
  • vlc: Package name.

removing vlc with apt command

After running the command, vlc will be removed from Ubuntu. You can also delete the apt keys with the apt command. Check this article to know about the full process.

Method 02: Using the “apt-get” Command to Uninstall Packages in Linux

apt-get is another package management tool used by Debian-based distros like Ubuntu. People use apt and apt-get commands interchangeably but their way of performing tasks is different to some extent. apt command is a more updated version of the apt-get command that can automatically handle tasks. In contrast, the apt-get command is a kind of low-level command and you have more control over it to install, remove, or update any packages. Here, using this command, I will show you some steps required to uninstall packages:

Steps to Follow >

➊ First of all, open the Ubuntu terminal.

➋  Write this command to update all the packages installed in your system:

sudo apt-get update
EXPLANATION
  • apt-get: Package management tool for Debian-based distributions to update, uninstall or install packages.
  • update: Updates all the package lists.

This command ensures that all the packages are updated so it’s a wise decision to update the package list before uninstalling any package.

all the packages in Ubuntu is updating with apt-get command

➌ Now run the next command to remove your desired package:

sudo apt-get remove vlc
EXPLANATION
  • remove: Removes software package.
  • vlc: Package name.

removing vlc using apt-get command

After running this command, a prompt will appear that will ask you if you want to continue or not.

a prompt is asking you to continue the removal process

The vlc software package will be removed after typing y. However, some unused dependencies still may exist which will reduce your storage space and eventually make your computer performance slow. Hence, removing unnecessary dependencies is also essential. Go through this article to know more about it.

Method 03: Using “dpkg” Command to Uninstall Packages

dpkg is a Debian-based package manager for installing, updating, removing, and managing software packages. It can uninstall the .deb package file format with all package dependencies. You can easily remove any .deb format packages by following the steps:

Steps to Follow >

➊ Open the Ubuntu terminal.

➋ Find the location of your deb package.

vlc deb package is in Desktop folder

Here, the .deb file of vlc software is in the “Desktop” folder.

➌ Now write the code to remove the package:

sudo dpkg -r vlc
EXPLANATION
  • dpkg: Debian package manager to install, uninstall, and manage software packages.
  • -r: Command option to remove package file.

This command is not enough to remove the package with all dependencies. Follow this article to check the command output and learn about removing package dependencies.

Method 04: Using the “snap” Command to Uninstall Packages in Linux

A single file named “snap” houses all of the application packages and dependencies. It serves as a package management system to simplify user installation and removal. The snap list command will show all of the snap packages, and you can then select the one you wish to remove. Now, follow the detailed steps explained below to remove packages:

Steps to Follow >

➋ Write this command to check the snap packages:

snap list
EXPLANATION
  • snap list: Lists all the snaps with their version and other information installed in the system.

all the packages listed in snap are here

You will find the desired package that you wish to uninstall in this snap list.

got the vlc package after scrolling for vlc package in the snap list

➌ Now write the following command to remove vlc:

sudo snap remove vlc
EXPLANATION
  • snap: Package management system where all the packages and their dependencies remain.
  • remove: Removes the selected package.

removing vlc package with snap command

vlc software package has been removed after running this command.

Method 05: Using the Synaptic Package Manager (GUI) to Uninstall Packages

A GTK-based (GIMP toolkit allowing programmers to create GUI) Graphical User Interface for installing, upgrading, and uninstalling software packages is called Synaptic Package Manager. Distributions based on Debian primarily use it. It also functions with rpm packages. To uninstall the package, you need to perform a couple of clicks according to the instructions below:

Steps to Follow >

➊ Click Show Applications and search for the synaptic package manager.

➋ Open the synaptic package manager.

Opening the synaptic package manager requires authentication. Type the Ubuntu password to get access to the package manager.

authentication is required to open the synaptic package manager

➌ After authentication, click the status option.

➍ Then go to the installed section to find the installed vlc software package.

➎ Search vlc using the search option.

searching for vlc in synaptic package

You can see the installed vlc package in this picture.

➏ Now Right-Click vlc then select ‘Mark for Removal’ or ‘Mark for Complete Removal’.

click mark for removal or mark for ccomplete removal to uninstall it

➐ Click apply to remove the marked vlc package after clicking ‘Mark for Removal’. You can also use ‘mark for complete removal’ to remove it completely from the system.

after selecting mark for removal click apply

When you click the apply option, the following window will come up:

select 'to be remove' and click apply to remove it

Uninstallation has started then.

uninstallation starts after applying all the changes

➑ To check all the changes applied, now click reload.

click reload to refresh all the packages

Finally, vlc package has been removed from this OS.

Method 06: Using Ubuntu Software Center (GUI) to Uninstall Packages.

A lot of individuals find it convenient to uninstall packages using the GUI. There are only a few clicks needed. People who are reluctant to write commands can use this method, despite the lengthy process. Just follow the steps mentioned below to remove your desired package:

Steps to Follow >

➊ First, go to Ubuntu Software.

➋ Click the installed section and find vlc.

➌ Click Uninstall.

removing vlc with Ubuntu software center

When you click the uninstall option, you will see the following prompt.

click uninstall to remove vlc

➍ After clicking uninstall, an authentication window will appear.

type your Ubuntu password to give permission to uninstall

➎ Type your Ubuntu password to initiate uninstallation.

when the uninstallation procedure will be completed, you can see there is no vlc package installed in the Linux system

You can notice that there is no vlc software in this image. The software program has finally been removed.

Comparative Analysis of Debian-based Methods to Uninstall Packages

In this article, I have covered 6 different ways to uninstall packages from Debian-based Linux systems. However, you don’t necessarily need all of them to remove your desired package. In order to choose the most effective strategy, carefully read this comparative analysis of each method.

Methods Pros Cons
Method 1
  • A user-friendly command that comes with many modern features and handles repositories automatically.
  • Less control over your machine as automatically do tasks.
Method 2
  • You gonna have more control over your machine as this command is not automated.
  • Unable to install any missing dependencies.
Method 3
  • Simple and easy method that can install packages from specific repositories.
  • Backdated tool for package management and not furnished with all the latest features.
Method 4
  • Offers better security and easier installation allowing multiple versions of applications to install on the same system.
  • Slower and requires more disk space.
Method 5
  • It can execute smart system updates and fix broken package dependencies.
  • Reduces command line dependability.
Method 6
  • Simple to use.
  • Only deals with packages that contain apps, not all the packages.

Now that you are aware of the advantages and disadvantages of each strategy, you can select the one that works best for you. If you’re still unsure which one to pick, consider my advice. In this case, the best method is Method 1, the most updated command with all the required features. However, pick method 5 if you feel more comfortable using a GUI. Lastly, if method 5 seems complex to you, pick method 6.

4 Methods to Uninstall Packages For Red-hat-based Linux Derivatives

If you use Red-hat-based derivatives such as RHEL, Fedora, CentOS, etc, don’t worry. I am presenting you with some reliable methods to uninstall your undesired packages. These distros have different package managers for managing packages. rpm, yum, dnf are the most popular here. Follow the methods mentioned below carefully to do your task successfully:

You can read our Comparative Analysis of Red-hat-based Methods to distinguish between these methods and best pick one for your need.

Method 01: Uninstalling Packages Using the “rpm” command

Many popular red hat-based distros like Fedora, CentOS, and RHEL by default use rpm (red-hat package manager) to install, uninstall, and upgrade rpm packages directly into the system. So, you don’t need to convert the rpm packages to any other format. In this rpm uninstall article, I have explained the uninstallation procedure of the google chrome software package.

Method 02: Uninstalling Packages Using the “yum” Command

YUM (Yellowdog Updater Modified) is another package manager used to install, search, query, remove, and manage software packages in Red-hat-based distributions. It is a front-end package manager and just the yum command alone can remove software packages with their unused dependencies. Now, follow the steps as instructed in this yum uninstallation guide to remove the google chrome software package. However, if you wish to remove a package without dependencies you can check this article. You can also uninstall a specific version of any package by following this guide.

Method 03: Uninstalling Packages Using the “dnf” Command

dnf command is the latest version of the yum command. It has some additional features which offer users a more user-friendly experience. This command has the potential to install packages from several repositories. In addition, it can cache packages locally. You can check this article to learn about the detailed uninstallation process.

Method 04: Uninstalling Packages Using GUI

The command-based technique may not be simple for some, but they don’t need to worry. Red Hat Enterprise Linux supports the GUI-based approach. To delete the software package you no longer require, follow the instructions:

Steps to Follow >

❶ Go to Activities, then click ‘Software’.

go to activities then click software to see all the installed software

❷ After that, click installed and find the software you wish to uninstall. Here I am going to remove google chrome software. When you will click the ‘uninstall’ option, a prompt will ask you if you want to uninstall or not. Now, click uninstall.

removing google chrome in red-hat linux

❸ To continue uninstallation, give your password to the authentication window.

authentication needed to uninstall any packages

Uninstallation will start then.

finally the google chrome is uninstalling

After everything is done correctly, your system no longer has Google Chrome installed.

Comparative Analysis of Red-hat-based Methods to Uninstall Packages

I’ve explored four distinct methods to remove packages from Red Hat-based Linux systems in this section. Read this comparison of the pros and cons of each approach thoroughly to determine the best path of action.

Methods Pros Cons
Method 1
  • Versatile and can create rpm packages from source code.
  • Performance is slow and can not install rpm packages from multiple repositories.
Method 2
  • Easy to learn and can install rpm packages from multiple repositories.
  • Doesn’t support all the useful features like other modern package managers.
Method 3
  • Better dependency resolver and faster than other package managers. It can also locally cache packages.
  • Difficult to troubleshoot problems and not well documented.
Method 4
  • Without knowing any command, the user can remove packages.
  • Time-consuming and lengthy steps.

After considering the benefits and drawbacks of each approach, you may now select your preferred one. However, I advise choosing approach 3 because it incorporates the most recent package management. Choose method 4 if you are unwilling to get the command-based approach.

Problem with Synaptic Package Manager

By default, Ubuntu has a ‘Ubuntu Software Center’ where you will find all the applications installed into your system.  However, you may not find a synaptic package manager in your Linux system, you can install that by writing this command:

sudo apt install synaptic
EXPLANATION
  • install: Command used for installing any packages.
  • synaptic: Package manager.

installing synaptic package manager in Linux

In this image, you can see that the synaptic package manager is installed in your Linux system. Now you will find the synaptic package manager to uninstall any packages.

Conclusion

I have covered 6 methods for Debian-based Linux derivatives and 4 methods for Red-hat-based Linux distros. Overall, there are primarily two approaches for uninstalling packages in a Linux system. One is based on the command line interface, while the other is based on a GUI. Here, I have described all the possible ways elaborately so you don’t need to be a pro-Linux user to do the task just follow the steps exactly as I have instructed. I hope, now you are capable to remove your preferred package without any difficulty.

People Also Ask

  
How to completely remove a package in Linux?
There are several ways to uninstall packages in Linux but for complete removal, this single command is enough, so run this command. ‘sudo apt remove –purge –autoremove [package name]’ to do the task.
How to uninstall in Linux command?
First of all, change the directory by running  ‘cd install_dir/bin’ command and then write this command ‘./uninstall.sh REMOVE EVERYTHING’ that will uninstall the package terminal.
How to uninstall a file in Ubuntu?
To permanently delete a file in Ubuntu, you have to select that item then PRESS and hold the SHIFT key. After that, PRESS the DETELTE key.
How to uninstall packages void Linux?
TX Binary Package Manager is managed by the void Linux team. All installed packages, orphaned packages, and cache package files can be removed with xbps-remove.

Related Articles


<< Go Back to Package Management in Linux | Learn Linux Basics

5/5 - (7 votes)
Mitu Akter Mou

Hello, This is Mitu Akter Mou, currently working as a Linux Content Developer Executive at SOFTEKO for the Linuxsimply project. I hold a bachelor's degree in Biomedical Engineering from Khulna University of Engineering & Technology (KUET). Experiencing new stuff and gathering insights from them seems very happening to me. My goal here is to simplify the life of Linux users by making creative articles, blogs, and video content for all of them. Read Full Bio

Leave a Comment