While performing an upgrade this weekend, I ran into an issue where a few packages were showing up twice in the rpm query output:

$ rpm -q -a | grep frysk
frysk-0.0.1.2006.10.02.rh1-1.fc6
frysk-0.0.1.2006.10.02.rh1-1.fc6

This was causing several package installations to fail, and was preventing me from upgrading several packages with known security issues. When I tried to remove the frysk package, I was greeted with the following error message:

$ rpm -e frysk-0.0.1.2006.10.02.rh1-1.fc6
error: “frysk-0.0.1.2006.10.02.rh1-1.fc6″ specifies multiple packages

After reading through the rpm manual page, I came across the “–allmatches” option. This allows a specific option to apply to all instances of a package, and allowed me to finally remove both occurrences of the frysk package:

$ rpm -e –allmatches frysk-0.0.1.2006.10.02.rh1-1.fc6

RPM can be such a pain sometimes, and I am still baffled how it got itself into this in the first place.

Posted by matty, filed under Linux Package Management. Date: February 5, 2007, 9:08 pm | 1 Comment »

The RPM indexes on one of my CentOS 4.4 machines got corrupted last weekend, which caused some issues on one of the servers I was trying to update. To fix this issue, I removed the files with two underscores in /var/lib/rpm:

$ rm -f /var/lib/rpm/__*

And then I recreated the indexes by running rpm with the “–rebuild” option:

$ rpm –rebuild

This experience taught me a few things:

1. The package header information is stored in /var/lib/rpm/Packages

2. RPM has an “–initdb” option to initialize the RPM database

3. I really don’t care for RPM

Posted by matty, filed under Linux Package Management. Date: November 29, 2006, 11:00 pm | 2 Comments »

The Redhat, Fedora and CentOS installer (anaconda) provides a series of graphical or text-based screens to step users through the OS installation process. One of the screens allows the user to pick one or more package groups to install, and optionally allows individual packages to be added and removed. I periodically forget to add groups when I perform interactive installs. Luckily yum understands package groupings, and contains options to update, query, install and remove groups of packages. To view all of the package groupings on a system, yum can be invoked with the “grouplist: option:

$ yum grouplist

Setting up Group Process
Setting up repositories
Installed Groups:
   Administration Tools
   Compatibility Arch Support
   DNS Name Server
   FTP Server
   Mail Server
   MySQL Database
   PostgreSQL Database
   Server Configuration Tools
   Web Server
   Windows File Server
Available Groups:
   AptRPM
   Authoring and Publishing
   Compatibility Arch Development Support
   Development Tools
   Editors
   Engineering and Scientific
   GNOME Desktop Environment
   GNOME Software Development
   Games and Entertainment
   Graphical Internet
   Graphics
   Horde-Apps
   KDE (K Desktop Environment)
   KDE Software Development
   Legacy Network Server
   Legacy Software Development
   Network Servers
   News Server
   Office/Productivity
   Printing Support
   Sound and Video
   System Tools
   Text-based Internet
   X Software Development
   X Window System
   XFCE-4.2
   drbd-heartbeat
Done

If you want to view the dependencies and individual packages that make up a specific group, the group name can be passed to the “groupinfo” option:

$ yum groupinfo Graphics

Setting up Group Process
Setting up repositories

Group: Graphics
 Required Groups:
   Base
   X Window System
 Default Packages:
   xsane-gimp
   ImageMagick
   netpbm-progs
   dia
   gimp-gap
   sane-frontends
   gimp-print-plugin
   gimp-help
   xsane
   gimp-data-extras
   gimp
 Optional Packages
   xfig
   kdegraphics

Yum also has the “groupinstall,” “groupremove” and “groupupdate”options to add, remove and update groups of packages. I digs me some yum.

Posted by matty, filed under Linux Package Management. Date: July 23, 2006, 8:15 am | No Comments »

If you are interested in using yum to manage packages on Linux servers, you might be interested in my article managing packages with yum. If you have comments or feedback, let me know.

Posted by matty, filed under Articles, Presentations and Certifications, Linux Package Management. Date: July 18, 2006, 10:53 pm | No Comments »

I run several CentOS 4.0 servers, and having to manually check each server for new updates is tedious. To simplify my life, I decided to write a shell script (yumnotifier) to E-mail me when new updates are available. The script (yumnotifier) analyzes the output from ‘yum check-update,’ and generates an E-mail similar to the following if updates are available:

From root@localhost.localdomain  Sat Jul 15 19:24:59 2006
Date: Sat, 15 Jul 2006 19:24:59 -0400
From: root 
To: matty@localhost.localdomain
Subject: Updates available for biscuit

==== The following updates are available for biscuit ===

comps.i386                               2:4.3CENTOS-0.20060314 base
gtk2.i386                                2.4.13-18              base
kernel.i686                              2.6.9-34.0.2.EL        update
libtiff.i386                             3.6.1-10               update
mysql.i386                               4.1.20-1.RHEL4.1       update
mysql-devel.i386                         4.1.20-1.RHEL4.1       update

If you manage systems that use yum, you might be interested in this script.

Posted by matty, filed under Linux Package Management. Date: July 16, 2006, 10:15 am | 1 Comment »

In a previous blog entry I touched on the process I use to generate weekly patch reports for my Solaris servers. I support several Fedora Core servers as well, and use the following cron job to generate weekly update reports similar to the ones I receive from my Solaris hosts:

0 0 * * 0 /usr/sbin/check4updates | /usr/bin/mail -s “Patch list for `/usr/bin/hostname`” matty

The check4updates script will compare the currently installed packages with those available in the configured yum repositories, and print the available updates to stdout. I pipe the output from check4updates to the mail command, which in turn causes an email similar to the following to show up in my inbox:

From: Super-User
To: matty
Subject: Patch list for pooh
Date: Sat, 15 Apr 2006 11:14:23 -0500 (EST)

Updates available for pooh
===
=== yum reports available updates:
===

ffmpeg.i386                              0.4.9-14_cvs20060301.r atrpms
gnupg.i386                               1.4.3-0_32.rhfc5.at    atrpms
libgcrypt.i386                           1.2.2-11.rhfc5.at      atrpms
libgpg-error.i386                        1.3-0_8.rhfc5.at       atrpms
libquicktime.i386                        0.9.8-15.rhfc5.at      atrpms
lirc.i386                                0.8.1-cvs20060325_57.r atrpms
mpeg2dec.i386                            0.4.0b-1.rhfc5.at      atrpms
pm-utils.i386                            0.15-1.4cubbi_suspend2 atrpms
sgml-common.noarch                       0.6.3-17_11.at         atrpms
spamassassin.i386                        3.1.1-1_29.rhfc5.at    atrpms
xml-common.noarch                        0.6.3-17_11.at         atrpms
xvidcore.i386                            1.1.0-8.rhfc5.at       atrpms

I digs me some Fedora core!

Posted by matty, filed under Linux Package Management. Date: April 17, 2006, 9:38 pm | No Comments »