RPM on MacOS X

Preparation

First you need to install rpm from a tarball. If you have not yet activated the root account, activate it by following the instruction given here so that you can "su" to root.
# su
# gnutar -zxvf tgz/rpm-4.0.2-0.34e-bin.tar.gz -C /
# setenv PATH $PATH\:/usr/local/bin
# rpm --initdb

The "rpm" relies on its own database for inter-dependencies of packages installed as RPMs. In particular it checks the existence of required shared libraries on your system. The problem is that those shared libraries should be registered into the database: it does not matter, as far as the dependency checking is concerned, whether they actually exist or not. Consequently, all of the system's standard shared libraries in /usr/lib need to be listed in the database. I prepared a dummy "system" package that installs nothing (, i.e. it's not going to overwrite any Apple-provided files) but just update the RPM's database for this purpose. Another problem is that the "rpm" command itself depends on some other packages such as gettext (libintl), bzip2, and db3. Installing the following RPMs will solve these problems.

# rpm -Uvh RPMS/ppc/system-10.2-1b.ppc.rpm --nodeps
# rpm -Uvh RPMS/ppc/gettext-0.10.35-4c.ppc.rpm
# rpm -Uvh RPMS/ppc/bzip2*-1.0.2-5b.ppc.rpm
# rpm -Uvh RPMS/ppc/db3*-3.2.9-2b.ppc.rpm

In addition, the following RPMs will be needed in many packages:

# rpm -Uvh RPMS/ppc/dlcompat-20021001-1a.ppc.rpm
# rpm -Uvh RPMS/ppc/readline*-4.3-3a.ppc.rpm

Now various rpm facilities should be usable. Optionally you can reinstall the "rpm" command itself from RPMs:

# rpm -ivh RPMS/ppc/popt-1.6.2-0.34e.ppc.rpm
# rpm -ivh RPMS/ppc/rpm*-4.0.2-0.34e.ppc.rpm

If you have previous 10.1 packages installed, you may want to uninstall redundant ones:

# rpm -e ncurses ncurses-devel
# rpm -e openssl-headers
# rpm -e tcp_wrappers-devel
# rpm -e texinfo
# rpm -e info

Basic Usage

Query

$ rpm -qa                       # to see list of all that installed
$ rpm -qi  foo                  # to get information on an installed package "foo"
$ rpm -ql  foo                  # to see list of files belonging to "foo"
$ rpm -qpi bar-1.0-1a.ppc.rpm   # to get information on a pre-installed rpm package
$ rpm -qpl bar-1.0-1a.ppc.rpm   # to see list of files belonging to "bar-1.0-1a"
$ rpm -qf  <filename>           # to check what RPM package owns the file

Installation / Uninstallation

$ rpm -ivh bar-1.0-1a.ppc.rpm                # to install "bar-1.0-1a"
$ rpm -Uvh foo-1.0-2a.ppc.rpm                # to update "foo"
$ rpm -Uvh --oldpackage foo-1.0-1a.ppc.rpm   # to revert this
$ rpm -e   foo                               # to eliminate "foo"

 

Update Record

2001/04/02    Release 0.34w: rpm version 4.0.2 built on MacOS X Public Beta
2001/04/21    Release 0.34a: rpm version 4.0.2 built on MacOS X Release 10.0.01 with some bug fixes: 2001/04/25    Release 0.34b: rpm version 4.0.2 built on MacOS X Release 10.0.01 with previously missing /var/local/{lib/rpm,tmp}.
2001/10/12    Release 0.34c: rpm version 4.0.2 built on MacOS X Release 10.1. You do not need to update RPMs for 10.0.X including those for the rpm itself.
2002/10/14   Release 0.34e: rpm version 4.0.2 built on MacOS X Release 10.2.


Back to Keisuke Fujii's HEP on X Page
keisuke.fujii@kek.jp October 16, 2002