yum
yum, rpm and duplicate versions
Apparently, when doing "yum update", and it fails miserably, you can end up with duplicate versions of packages in the RPM database. This seems harmless, but is annoying. yum provides a tool to check for this, but I was not able to find anything that would automatically repair it. So here's a little tip:
$ yum check duplicates | awk '/is a duplicate/ {print $6}' > /tmp/DUPES
$ yum remove `cat /tmp/DUPES`
Of course, before you remove the dupes, make sure to examine the tmp file (/tmp/DUPES) and make sure it looks ok.
Update:
There seems to be a command to do this, package-cleanup has an option for it. E.g.
$ package-cleanup --cleandupes
However, testing this command on a second box having the same problem gave bad results, it seems to have uninstalled the "real" packages too.
Fedora and debuginfo
A while ago, I wrote about installing System Tap on my Fedora box, which requires some debuginfo packages. I mumbled something about what yum commands to use, here. As it turns out, this is a common enough task to do that there's a special Python Yum application for it, debuginfo-install. For example:
# debuginfo-install gcc.i386 glibc.i686
Neat!
rpm, yum and broken perl installation
My Fedora Core 7 box recently ended up in some state where my perl installation was seriously messed up. I'd get errors about mismatch in platform architecture, problems with sockets etc. etc. So, I really wanted to have yum reinstall all my perl packages. I couldn't find a way to do that, but I managed to achieve something similar using various commands. Here are the steps I followed:
# rpm -qa --qf '%{NAME}\n' | grep '^perl-' > /tmp/perl.pkgs
# rpm -e --justdb --nodeps perl `cat /tmp/perl.pkgs`
# mv /usr/lib/perl5 /usr/lib/perl5-
# yum install perl `cat /tmp/perl.pkgs`
PLEASE! Be careful with these commands, make sure you know what you're doing, check the /tmp/perl.pkgs file to make sure it seems reasonable etc. Once this is all done and finished, I removed the old perl5 library (perl5-).
As an alternative, you could also do something like
# rpm -q --qf '%{NAME}\n' --whatrequires perl > /tmp/perl.pkgs
but that will reinstall more packages than absolutely necessary, I think.
Fedora Core and SystemTap
I wanted to get SystemTap to run on my Fedora Core 6 box, and had problems getting it running. The README says to install the kernel-debuginfo, which I had problems getting going. It turns out I was just being stupid, and didn't run yum properly. All I really had to do was:
% sudo yum install systemtap
% sudo yum --enablerepo=core-debuginfo --enablerepo=updates-debuginfo install kernel-debuginfo
More information about System Tap is available here.
yum and repository priority
I use yum on pretty much a daily basis, and I've added a small collection of repos (repository). I use livna and FreshRPMs for instance. Now, for some reason these two repositories overlap, meaning, if I run yum update, livna will try to upgrade my freshrpm packages. Up until now, I've managed around this by using --enablerepo and --disablerepo. However, there's a much better way, I installed a yum plugin called yum-priorities.
Using yum (obviously), I simply installed this on my Fedora Core box with
# yum install yum-priorities
With this plugin installed, all I have to do is to give the FreshRPMs repo a higher priority (lower priority value) than the livna repo (default priority is 99). For example:
[freshrpms]
name=Fedora Core $releasever - $basearch - Freshrpms
priority=80
.
.
.
Now when I run yum update I get a message like
...
Loading "priorities" plugin
Setting up Update Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
0 packages excluded due to repository protections
96 packages excluded due to repository priority protections
No Packages marked for Update/Obsoletion
Fedora development and yum-utils
On my system at home, I run the latest Fedora development packages, which has both pros and cons. For instance, I'm pretty always up to date with all the tools I use, all automatically. However, it can be a pain sometimes to get yum to update properly, and a few times major breakage happens :-).
A while ago, I realized that there's a package availabe, called yum-utils, which provides quite a few useful tools, in particular, there's now a new repoquery tool. This can be used similar to the old rpm --fedoraprovides syntax, as well as many other uses. For instance
root@thor 426/0 # repoquery --whatprovides python
python-0:2.4.2-2.i386
root@thor 427/0 # repoquery --whatrequires python
plone-0:2.1.1-1.fc5.i386
mach-0:0.4.8-1.fc5.i386
system-config-lvm-0:1.0.8-1.0.noarch
rhn-applet-0:2.1.17-4.i386
plone-0:2.0.5-3.noarch
.
.
.
To install yum-utils (if not already installed, and you have yum properly configured for the development repo), all you do is
root@thor 428/0 # yum install yum-utils
Oh, and while I remember it, the old rpmdb-fedora DB package shouldn't be needed any more, I simply uninstalled it with
root@thor 329/0 # rpm -e rpmdb-fedora
Fedora Core "devel" packages and yum
I try to keep my system up to date using the Fedora "devel" packages, using the yum updater. Sometimes I would get errors like
unsigned package //var/cache/yum/development/packages/glibc-2.3.4-3.i686.rpm
unsigned package //var/cache/yum/development/packages/eog-2.8.1-1.i386.rpm
unsigned package //var/cache/yum/development/packages/pango-1.8.0-1.i386.rpm
The problem here is that not all development packages are signed, for whatever reason. Assuming you still trust Fedora, simply modify your yum configuration file (/etc/yum.repos.d/fedora-devel.repo in my case) to add a line like
gpgcheck=0