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.

Subscribe to Newsletter!
Get notified when new articles are published!
We promise to never share your email!
icon

Author: KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Leave a Reply

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

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.