The rpm Package Manager

This just covers the rpm specification and its format. See elaboration.

More good links to peruse...

Installing a package...

To install a package:

	[email protected]:~> rpm -ivh package-path

To upgrade an existing package:

	[email protected]:~> rpm -Uvh package-path

Removing a package...

Get the package-name via inspection (see “Inquiring about a package’ below). To remove (uninstall) a package:

	[email protected]:~> rpm -e package-name

Inquiring about a package...

Presently loaded?

	[email protected]:~> rpm -qa | grep vas

Can a package be unloaded? Try it with option -e (as expected) accompanied by --test.

	[email protected]:~> rpm -e --test vasclnts-3.1.0-19
	error: Failed dependencies: is needed by (installed) vasgps-3.1.0-19 is needed by (installed) vasyp-3.1.0-19 is needed by (installed) vasproxy-3.1.0-19

Package-query options are preceded/accompanied by option -q.

--provides: package(s) provide(s) vasclnts-3.1.0-19? Some of what is in parentheses constitutes “capabilities” for the --whatrequires and whatprovides options, but not all.

	[email protected]:> rpm -q --provides vasclnts-3.1.0-19
	vasclnts = 3.1.0-19

--requires: lists packages on which vasclnts-3.1.0-19 depends...

	[email protected]:~> rpm -q --requires vasclnts-3.1.0-19
	pam >= 0.66-5 /bin/sh /bin/sh


These next two are a joke outside a given shop’s own packages. “Capabilities” are something a package can make up to say it supports. So, unless you know the name of a capability, this is useless.

--whatprovides: package provides some capability...

	[email protected]:> rpm -q --whatprovides crapola
	no package provides crapola

--whatrequires: package require some capability...

	[email protected]:> rpm -q --whatrequires crapola 
	no package requires crapola

Nevertheless, on my SuSE Linux box, some of what is in parentheses up above are capabilities including and

Package information...

Get a list of everything in the package including version information, paths, files, etc. This is for the VAS site-license client. (Some slight reformatting here including wrapping.)

	[email protected]:~> rpm -qil vasclnts-3.1.0-19
	Name        : vasclnts
	Relocations : (not relocatable)
	Version     : 3.1.0
	Vendor      : Quest Software, Inc.
	Release     : 19
	Build Date  : Wed 13 Sep 2006 02:30:17 PM MDT
	Install date: Thu 14 Sep 2006 10:16:04 AM MDT
	Build Host  :
	Group       : System Environment/Applications
	Source RPM  : vas-3.1.0-19.src.rpm
	Size        : 6610630
	License     : Commercial
	Signature   : (none)
	URL         :
	Summary     : The VAS client components (site licensed)
	Description :
	The client components of VAS: vasd, nss_vas, pam_vas, and vastool.
	This version of the vasclnt package does not require a license.
	Distribution: (none)

More notes on upgrading...

In some package scripts such as the post-install, the passed argument contains “the number of packages we’re dealing with.” In other words, 1 if we’re only dealing with the package to install afresh, 2 if both a new and an old (existing) package.

This fact can be useful in writing such a script, for example, in knowing whether or not to restart a dæmon. Below are the first few lines to put in this script which is also used for Debian/Ubuntu packaging:

	case "$1" in
	  configure|upgrade)              # Debian-only
	    if [ -f /tmp/vasclnt_upgrade ]; then
	  remove)                         # Debian-only, but should not occur here:
	    pkg_count=0                   # this is only to keep the script from bombing
	  *)                              # rpm only passes an integer value
	    pkg_count=$1                  # Linux (rpm) passes an integer 1 or 2

Generating a spec...

To generate an rpm specification, include a template as in the main project (package) directory. The template is identical to any rpm specification except that the version field should contain @VERSION@ so that when built, it gets changed appropriately.

Add package-name.spec to the AC_OUTPUT macro in and both package-name.spec and to the EXTRA_DIST macro in

At this point, the following command may be issued:

	# rpm -tb package-name.spec

Debian package manager details

For Debian/Ubuntu, see documentation at These are the commands we’re going to use in an installation script...


   dpkg -i package-file.deb

Uninstall (remove):

   dpkg -r package-name


   dpkg -A package-file.deb

Information/ontology (search):

   dpkg -C

List information (less than clearly indicated in the man page):

   dpkg -l package-name