14 C
Jaipur
Sunday, November 29, 2020

How do I Uninstall a Yum Package? – Linux Hint

Must read

Gaming laptop deal: save $390 on the Dell G5 15 in the early Cyber Monday sale

We've just spotted a fantastic gaming laptop deal over on the official Dell website for anyone looking for a solid first step into the...

Where to buy Oculus Quest 2 on Cyber Monday – and why are there no deals?

Looking for Oculus Quest 2 Cyber Monday deals? Unfortunately, we haven't really seen any across the Black Friday weekend. In fact, the VR headset...

See how iPhone XR deals came down to only £20 a month this Black Friday weekend

If you're in the market for a fairly priced iPhone, it's likely you'll have considered some iPhone XR deals before. While it's not quite...

Xbox Series X controllers are at their best price yet for Cyber Monday

If you're after a good Xbox Series X Cyber Monday deal, these Xbox Series X controllers should do just the trick. You'll find a...

Any Linux distro is a collection of numerous packages. To keep all of them in order, a suitable package manager is a must. Depending on what type of package the distro uses, the package manager differs. In the case of distros using the RPM package, yum is the package manager. It’s available on CentOS, RHEL, and other RPM-based distros (Fedora, and OpenSUSE, etc.). However, it’s mostly used on CentOS and RHEL.
This guide showcases how to uninstall a yum package.

Uninstall yum packages

Uninstalling a package is one of the fundamental functionalities a package manager has to provide. In the case of yum, it comes with a handful of ways to uninstall a package. Note that these are RPM packages that yum is uninstalling from the system.
In this guide, I’ll be using CentOS 8.2 to demonstrate the methods.

Prerequisites

To perform any system-level change on any Linux distro, you need to have sudo privilege or root access. In the case of CentOS, you need to have access to the root or any other user that can run sudo commands.
By default, CentOS disables sudo privilege to all the users (except root). Here, I’ll be logging in as root to perform the actions.

Uninstall package using yum

List installed packages
Before uninstalling a package, first, you need to know the package name. The following command will list all the installed packages.

The output can be filtered using grep. For easier reading, you can pass it to less.

$ yum list installed | grep <search_term>

$ yum list installed | less

Basic package uninstallation
This is the very basic way of uninstalling a package using yum. Assuming you know the package name to uninstall, run the following command.

The same command structure works in case you want to uninstall multiple packages.

$ yum remove <package_1> <package_2>

Uninstall package group
Grouping is an interesting feature that yum comes with. Just like you can install all the packages under the same group, you can also uninstall them.

Let’s break it down with a quick example. The group “Development Tools” includes all the necessary tools for software development. It includes packages like gcc, automake, cmake, git, etc. Just like installing a group, yum offers a way of uninstalling a group as well.

To uninstall a group, run the following command.

$ yum remove @“<group_name>”

Alternatively, use this command. It does the same job but the command structure is different.

$ yum group remove “<group_name>”


Automate removal confirmation prompt
Whenever removing any package/group, yum will ask for confirmation. If you don’t want to face the prompt, then you can use “-y” to answer “yes”.

$ yum remove <package_name> -y

Final thoughts

Uninstalling packages on yum is quite simple. All it requires is the name of the target package and root privilege. However, this isn’t the only feature yum offers. It’s a powerful package manager that can do lots of things.

For a quick review of what yum is capable of, check out the yum help page.

Happy computing!

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Gaming laptop deal: save $390 on the Dell G5 15 in the early Cyber Monday sale

We've just spotted a fantastic gaming laptop deal over on the official Dell website for anyone looking for a solid first step into the...

Where to buy Oculus Quest 2 on Cyber Monday – and why are there no deals?

Looking for Oculus Quest 2 Cyber Monday deals? Unfortunately, we haven't really seen any across the Black Friday weekend. In fact, the VR headset...

See how iPhone XR deals came down to only £20 a month this Black Friday weekend

If you're in the market for a fairly priced iPhone, it's likely you'll have considered some iPhone XR deals before. While it's not quite...

Xbox Series X controllers are at their best price yet for Cyber Monday

If you're after a good Xbox Series X Cyber Monday deal, these Xbox Series X controllers should do just the trick. You'll find a...

Incredible Cyber Monday deal: save £1,877 on this 55-inch Alienware gaming OLED monitor

Dell has stolen the limelight this sales season with the Alienware 55-inch AW5520QF getting a major £1,877 price cut – and this stellar early...