YUM for Weekend Warriors
A collection of the things I routinely forget when I'm setting up a new Red Hat/Fedora system.
Sunday, 2010-03-28 | AlmostEffortless, Careerism
Generally speaking, I'm a Debian guy.
Sure, I'll mess around on the CentOS box under my desk on the production RHEL servers at work a little bit, but Red Hat is largely terra incognita for me and Debian is where I'm comfortable doing my admin thing and managing packages. I know apt. I am comfortable with apt. And while I wouldn't describe using yum as something that makes me uncomfortable, when I do have to use it, I find myself spending more time Googling and forum-searching than I'd like.
I'm beginning to accept that this is no one's fault but my own.
And so the purpose of this article, therefore, is not a.) to point fingers, b.) to compare apt to yum or c.) to explain yum from the perspective of someone who is accustomed to doing things the Debian way. The Internet is littered with stuff like that like the intersection of Paradise and Tropicana is littered with advertisements for escorts.
In this post you'll find some novice-level trouble-shooting tips, reminders and pointers for the casual yum user that are intended to help reduce the occurrence of forehead-slaps and to decrease the amount of time spent tailing logs and Googling obscure error messages.
Preemptive Troubleshooting.
It's not in the documentation, but I have noticed that a lot of dependency issues and version consistency problems are resolved by tossing off the following yum command and then trying again:# yum clean packages
I've noticed that it's generally not the advice of performance-minded (read: impatient) admins to do the more scorched-Earth yum clean all, as this empties caches, dbcaches (i.e. sqlite files) and can causes longer check-update times.
filelists.xml.gz Download Times out.
Let's say you're doing a yum update or a yum upgrade and you get some output like this:filelists.xml.gz 100% |=========================| 1.4 MB 00:01 filelists.xml.gz 100% |=========================| 1.3 MB 01:48 http://apt.sw.be/redhat/el5/en/i386/dag/repodata/filelists.xml.gz: [Errno 4] Socket Error: timed out Trying other mirror.
Generally speaking, you can navigate to a repository's http site and find the URL for their public key. Once you've got that, all it takes to import it is one of these:
# rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
Know your repositories
You can save a lot of backtracking/head-scratching time if, before searching for a package on a machine you don't visit that often, you toss off a quick yum repolist. This handy feature will spit out the names and statuses of all of the repositories in all the files in your /etc/yum.repos.d/ directory and prevent you from doing that thing where you don't realize that you've only got the default CentOS repositories enabled but can't seem to figure out why the eff your yum search for htop just turned up a big goose-egg.Automatic Notifications
If, like me, you're coming at yum from a Debian perspective, one of the first things you'll do when you start administering an RPM-based system is to install the apticron-equivalent known as yum-updatesd (# yum install yum-updatesd.noarch). Something you might forget, however, is that the default behavior of yum-updatesd is to not send emails.Don't forget to edit /etc/yum/yum-updatesd.conf such that mit_via = dbus looks like mit_via = email or you won't get those all-important package update emails.
...And that's about all that's coming to mind right now.
