Learn RPM
Swe03
Packaging and Installing Software with RPM
In these exercises you learn to use and create RPM packages.
Since the use of RPM requires root permissions, it is necessary to use
User Mode Linux. The idea is that you create RPM packages in the normal way (i.e., on the host machine), and then install them in an UML virtual machine.
Using RPM Packages
In these exercises you learn to use the
rpm command to install,
erase, and upgrade packages. Use for these exercises the toy RPMs for
the hello-1.0, hello-2.0, and xhello-1.0 packages. After each
operation find out whether the hello and xhello tools work, and what
their behaviour is.
Note once again that all installing and querying steps are done in the UML machine.
- Obtain the RPMs for the hello packages
- Installing, upgrading, erasing
- Try out different orders of installing, erasing,
and upgrading the hello-1.0, hello-2.0 and xhello-1.0
packages and observe their effects; change the
configuration files during the process; see the
slides.
- Install with and without documentation
- Erase after changing the configuration file
/usr/share/hello/hello.config
- Erase hello after installing xhello
- etc.
- Querying and verifying
- Get the description of the hello-1.0 package
- Create a list with all packages that are
installed on your machine
- Write a (verification) query to detect all
configuration files that have been changed.
- Find out what the dependencies are of the hello
packages and some other packages on your machine.
- Create
~/.rpmmacros and define the _topdir variable (see
Poiriers article or Fullhart's RPM Tutorial) on the host machine, since that's where we're going to build packages.
- Install the SRPMS for the
hello and xhello packages (on the host machine).
- Unpack the sources and inspect them
- Inspect the .spec files
Creating RPM Packages
In these exercises you learn to build your own RPM packages.
- Use
rpm -ba to build RPMs for the hello packages. Observe
what happens. (Note that under RedHat 8.0 building should be done with rpmbuild instead of rpm.)
- Write a .spec file and build an RPM for the interpreter package
from the previous exercises. Verify that you can install them in the UML machine. (Note
that this may not work due to incompatible versions of the OS on the UML.)
Are there any dependencies?
- Extend the Makefile of the interpreter source tree with an
rpm
target that creates the RPM.