FUNDAMENTALS A Complete Guide for Beginners
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.
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.
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
- 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.
Now, the Debian file of vlc is ready to uninstall.
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
- apt: Provides a high-level command line interface for the package management system.
- remove: Command removes a package.
- vlc: Package name.
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
- 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.
➌ Now run the next command to remove your desired package:
sudo apt-get remove vlc
- remove: Removes software package.
- vlc: Package name.
After running this command, a prompt will appear that will ask you if you want to continue or not.
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.
Here, the .deb file of vlc software is in the “Desktop” folder.
➌ Now write the code to remove the package:
sudo dpkg -r vlc
- 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
- snap list: Lists all the snaps with their version and other information installed in the system.
You will find the desired package that you wish to uninstall in this snap list.
➌ Now write the following command to remove vlc:
sudo snap remove vlc
- snap: Package management system where all the packages and their dependencies remain.
- remove: Removes the selected package.
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.
➌ 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.
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 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.
When you click the apply option, the following window will come up:
Uninstallation has started then.
➑ To check all the changes applied, now click reload.
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.
When you click the uninstall option, you will see the following prompt.
➍ After clicking uninstall, an authentication window will appear.
➎ Type your Ubuntu password to initiate uninstallation.
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 |
|
|
Method 2 |
|
|
Method 3 |
|
|
Method 4 |
|
|
Method 5 |
|
|
Method 6 |
|
|
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:
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’.
❷ 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.
❸ To continue uninstallation, give your password to the authentication window.
❹ Uninstallation will start then.
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 |
|
|
Method 2 |
|
|
Method 3 |
|
|
Method 4 |
|
|
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
- install: Command used for installing any packages.
- synaptic: Package manager.
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
Related Articles
- How to Uninstall RPM in Linux [2 Simple Cases]
- How to Uninstall a YUM Package [2 User-Friendly Cases]
- How to Remove a Specific Version Using YUM [2 Easy Methods]
- How to Force Remove a Package Without Dependencies Using Yum [2 Methods]
- How to Remove and Purge a Package Using apt-get [4 Methods]
- How to Remove Apt-key in Linux [3 Practical Methods]
- How to Remove Package and Dependencies Using dpkg [4 Cases]
<< Go Back to Package Management in Linux | Learn Linux Basics