How To: Remove A Package With YUM

Today’s article is pretty basic, as the title so helpfully implies, as it simply tells you how to remove a package with YUM. I am writing this article because of a comment sent to me via the contact page. The gist of the comment is that I seldom include information about YUM but lots of information about APT.

I welcome such. If I didn’t, I wouldn’t have the option to contact me! In a similar vein, if I didn’t welcome comments WordPress would happily allow me to disable said comments. I welcome all that sort of stuff, even including the comments I get elsewhere. For the record, some of those comments are so good that they’d be welcomed additions to the articles themselves. Alas, so few people seem inclined to do so and their helpful additions are lost to the aether.

Anyhow, back to the comment sent via the contact page…

The person sending me the message is correct. It’s true. More often than not, I only include information about APT. In my defense, other than servers or playing around in virtual machines, APT is my usual weapon of choice. I’m familiar with it, indeed comfortable with it. As such, my brain just kinda defaults to it.

So, what is YUM? Well, YUM is like APT for people using RHEL, CentOS, Fedora, Rocky, and quite a few other choices, might I say professional, operating systems. While the numbers I can find indicate the APT-using distros dominate the desktop market, it’s almost certain that the server market is dominated by people using a distro with YUM as the package manager.

YUM stands for Yellowdog Updater, Modified. It is the package manager for distros using the RPM (Red Hat Package Manager) formatted, or standardized, packages. It is very old and very stable. Those are not bad things, especially in the server and professional markets – where things like stability are prized. If you used YUM back in the day, I have good news for you. It hasn’t changed! Well, not significantly, as Wikipedia happily tells me that the last stable version was about eleven years ago at the time of this writing. Again, that is not a bad thing! I can’t stress that enough.

Because I don’t cover YUM enough, I figure a nice introductory article will be good. It’ll be a good thing to expose folks to YUM when they’re mostly just familiar with APT. As such, I figure some basic commands are a good place to start. 

So, let’s get to it…

Remove A Package With YUM:

Of course, you use YUM in the terminal. That means you’ll need to have an open terminal. In most distros, you can just press CTRL + ALT + T and your default terminal should open. If this doesn’t open your terminal, you can almost certainly find a quick and easy way to modify your keybindings.

With your terminal now open, the process is pretty simple to remove a package with YUM. The command would look something like this:

You can also use the following format:

Those commands will only remove the package you named. So, if you removed a program like Thunderbird, your configuration files and any dependencies will (should) remain on the system. This is useful for when you need to reinstall an application but want to try keeping your existing configuration.

If you want to also remove your configuration files and any dependencies, YUM will happily allow you to do that. To do so, that is to remove the application, any configuration files, and dependencies, you’d try a command like this:

While it may look similar, it functions differently than autoremove functions in distros like Ubuntu. So, the syntax may look similar, but there are differences between the commands and it may be prudent to remember that. After all, the goal is to remove a package with YUM and not APT.

If you want to get fancy, you can add the following to your /etc/yum.conf to make sure that when you remove a package with YUM it will automatically remove the dependencies and configuration files:

However, adding that command will mean you do exactly what I said you’d do if you did that. You will also remove your configuration files and any of the application’s dependencies. If you’re sure that’s what you always want to do, you can do it! Ain’t Linux awesome?!?

Closure:

Well, I wanted to write an article about YUM for our RHEL-using peers. I didn’t want it to be too basic, so I figured I’d add a little more to it. The reality is that I don’t cover other distros that often but, in my defense, this is largely aimed at making Linux approachable – or, as the tagline says, “Getting you up to speed.” Most of my readers are going to be using distros with APT and much of my content is generic enough to apply to any major Linux distro.

So, there’s that… If you want to see even more of this type of content, leave a comment (here, preferably) to let me know. I ain’t scared! If this is the type of content that suits you, that’s great and I can write more of it. It’s not hard to include the commands for other distros, it’s just time-consuming.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Prevent Application Updates With ‘YUM-VERSIONLOCK’

I recently wrote a similar article, illustrating how you can use ‘apt-mark’ to prevent application updates. While that was handy, it only applied to those who use APT as their package manager. It offered nothing of value to those who use YUM.

This article will explain how you can prevent application updates with ‘yum-versionlock’. You will learn how you can temporarily prevent application updates when you have no choice but to.

In the previous article, I explained that you should always use the most up-to-date software that you can, at least if your system is connected to the public internet. Software updates provide security fixes, not just bug fixes.

Not updating means you’re vulnerable and your vulnerabilities may impact other users. For example, your computer may become a part of a botnet, a spam relay, or even be used as a command and control device for those things. As a global citizen of the ‘net, you’re obligated to do what you can to minimize harm.

So, it is possible to prevent application updates, but you really should only do so when it’s absolutely necessary. In an ideal world, you’d be able to always use the updated version, but we don’t live in that world. We live in the real world, where we have things like compliance and compatibility issues. 

YUM, what is it? YUM stands for Yellowdog Updater, Modified. It’s a package management utility for RPM based distros. You’ll find YUM in distros like RHEL, Fedora, and even OpenSUSE. It’s fairly widely used, though many of the RPM-based distros are more prominent in the server space than they are in the desktop space.

These days there’s actually DNF (which stands for Dandified YUM – don’t blame me, I don’t name these things) but that’s not important today. Today, we’ll be using ‘YUM-VERSIONLOCK‘ to prevent application updates.

Prevent Updates with ‘yum-versionlock’

Unlike ‘apt-mark’, you’ll need to install something in order to do this. It should also be mentioned that there are other ways to accomplish this, but this is the easiest way to prevent application updates. Using versionlock is the most straightforward way of accomplishing this.

First, you’re gonna need to crack open your terminal. You can do that by using your keyboard. Just press CTRL + ALT + T

Once your terminal is open, you’ll need to install ‘yum-versionlock’. You can try this first:

If that gives you an error, I can’t figure out where the name changed, then you can most likely install it with:

Once you have it installed, you can check the man page to see how you use it. Even if you installed it with the second command, the man page is still found at:

The one-liner quite accurately defines versionlock as:

yum-versionlock – Version lock rpm packages

Anyhow, to use it to hold a package at its current version, you simply use:

NOTE: The command supports wildcards. You can use an asterisk with this command. The command will give you feedback. You can also use ‘add’, but it’s redundant.

If you want to remove the lock, which you should do as soon as realistically possible, then the command is fairly evident. It’s just:

If you, like me, don’t always keep the best notes and don’t have the greatest memory, then you can list the locked packages with this command:

There’s no need for elevated permissions with that command, but it will take a little while for it to complete. It will output any locked packages and you can unlock them individually. Again, you can use wildcards in this command.

However, you can remove all the locks with just one command:

As you might expect, that removes all the locks and your system will resume updating normally. You should not keep software locked to one version for long. Though you may be using a LTS-type distro, only getting minor point release upgrades, you are still getting security updates. Keeping your system secure makes you a good netizen. 

Closure:

And there you have it. Another article in the books, this one explaining how to stop updates for specific applications. Thanks for reading and feel free, nay encouraged, to leave feedback. If you have any ideas for articles, feel free to share them. You can also contribute by writing your own article. I’ll even edit it up for you!

Don’t forget that there’s a newsletter (we never spam or share your address with anyone, it’s all in-house) and you can even donate. I’d kinda like the site to at least pay for itself, simply out of principle. If not, there are ads you can unblock! Even if you do none of those things, there are good odds that I’ll keep this site up, running, and interesting.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.