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.

  1. Obtain the RPMs for the hello packages

  2. Installing, upgrading, erasing

    1. 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.
    2. Install with and without documentation
    3. Erase after changing the configuration file /usr/share/hello/hello.config
    4. Erase hello after installing xhello
    5. etc.

  3. Querying and verifying

    1. Get the description of the hello-1.0 package
    2. Create a list with all packages that are installed on your machine
    3. Write a (verification) query to detect all configuration files that have been changed.

    4. Find out what the dependencies are of the hello packages and some other packages on your machine.

  4. 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.
  5. Install the SRPMS for the hello and xhello packages (on the host machine).

    1. Unpack the sources and inspect them
    2. Inspect the .spec files

Creating RPM Packages

In these exercises you learn to build your own RPM packages.

  1. 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.)
  2. 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?
  3. Extend the Makefile of the interpreter source tree with an rpm target that creates the RPM.