Notes about how to use Red Hat’s
rpm (Red hat Package Manager).
Don’t forget to also check out notes on yum, a
program that resolves package dependencies and automates many
tasks in normal situations such as system updates.
Information about archived packages (.rpm files)
To list the package summary of an rpm file that isn’t installed yet:
rpm -qip ./pgp-2.6.3i-1.i386.rpm
To list the files contained in the package:
rpm -qlp ./kdeutils-1.0-2rh51.i386.rpm
-p::package file as opposed to a normal file
Information about files that came from an rpm archive
To find out what package a file came from:
rpm -qf /bin/chown
To list the files in a package:
rpm -ql fileutils
To list information about a known installed package:
rpm -qi fileutils
To install a package in the ordinary way:
rpm -ivh ./pgp-2.6.3i-1.i386.rpm
i::install v::verbose h::hash marks
-U which is not uninstall, but rather "upgrade". This
sorts out some things that
-i does not deal with and is usually a
safer installation option.
To uninstall a package in the ordinary way:
rpm -e fileutils
fileutils is the name of an installed package
It is rumored that
rpm can restore messed up permissions for files installed from an
rpm --setperms <packagename>
Installing Source Code
I had a spot of trouble figuring out how to get at source code that was bundled up in an rpm. These files don’t have paths attached to them. They simply go where the global setting for source files should go. To figure out what that is try this:
That should show you the SOURCE directory. Do the install as if it were
a normal rpm (with
rpm -ivh XXXX.src.rpm). Nothing seems to happen.
You have to go to the directory specified. I think that you can
specify this directory on a per user basis with a personal
Pack List Information
I used to have a big text file that I kept around that contained the RPM descriptions of all of the packages that were on Red Hat 5.0. This file wasn’t extraordinarily large, but large enough that I wanted to get rid of it. So it is replaced with this file that explains how to get the information you need directly from your system using rpm commands.
To generate a list of information about all of the packages that you have installed:
To generate a list of information about all of the packages that you could install from a distribution cd:
rpm -qip /mnt/cdrom/RedHat/RPMS/*
To generate a list that contains the previous and following 10 lines surrounding a reference to a certain word:
rpm -qip /mnt/cdrom/RedHat/RPMS/* | grep -10 "emulator"
From this, you can often narrow down a search.