Chapter 14. URPMI rpm downloader, installer and dependency solver

Table of Contents

14.1. URPMI
14.1.1. What is URPMI?
14.1.2. What You Get With It?
14.2. Parallel Feature
14.2.1. Installing the Parallel Feature
14.2.2. Configuring the Nodes
14.2.3. The /etc/urpmi/parallel.cfg File
14.2.4. Running urpmi in Parallel
14.3. urpmi recover

14.1. URPMI

14.1.1. What is URPMI?

URPMI is a wrapper to rpm that automatically handles dependencies, making software installs easier. Just give urpmi the package you want and it will install it, getting packages either from cdrom, ftp or a local repository of rpms. The nice thing is that dependencies are handled automatically. It even handles multi-CD (it asks you politely to put the CD labeled ``xxx'').

Have you ever heard about apt-get? Well, urpmi does the same for rpms :) You can compare rpm vs. urpmi with insmod vs. modprobe or dpkg vs. apt-get.

14.1.2. What You Get With It?

  • urpmi: installs the package(s) you ask it to.

  • urpmf: searches for a file through all available packages, for example:

    urpmf 'bin/x?emacs$'
    emacs-X11:/usr/bin/emacs
    xemacs:/usr/bin/xemacs

  • urpmi_rpm-find-leaves: returns the packages not required by any other package. These are the packages that you should look at first when doing some housekeeping.

  • urpmi.addmedia: this one is for the system administrator. Use it to initialize urpmi's database, for example.

  • urpmi.update: also for the system administrator. Used to sync with one ore more rpm repositories that have changed. Useful for cooker or rawhide.

  • urpmi.removemedia: also for the system administrator. Guess what this one does! (or look at its man page :)

14.2. Parallel Feature

Urpmi can be used in a special parallel mode that allow people to install packages on a cluster. To use this feature add --parallel option. It's activate distributed execution of urpmi to other machines. It is mandatory that urpmi is installed, but it is not necessary to have media defined on any machines. Alias defines which extension module is to be used by urpmi (currently, urpmi-parallel-ka-run or urpmi-parallel-ssh are available) and which machines should be updated. This alias is defined in the file /etc/urpmi/parallel.cfg as described below.

14.2.1. Installing the Parallel Feature

You just have to install the package named "urpmi-parallel-ka-run" on the server and all nodes.

14.2.2. Configuring the Nodes

You just need to have ka-run installed on each node, and ssh's server root public key stored in /root/.ssh/authorized_keys. To generate ssh's server root private and public key just run as root user:

ssh-keygen -t dsa

All is pre-configured under IGGI release, so you don't need to regenerate a key and copy it on all nodes.

14.2.3. The /etc/urpmi/parallel.cfg File

This file contains the description of your node's group. You can use "ka-run" or "ssh". This file is on server, and if you want to use the ka-run module the syntax is:

group_name:ka-run -c ssh:-m node1 -m node2 -m node3 ...

If you want to use the "ssh" module the syntax is:

group_name:ssh: -m node1 -m node2 -m node3 ...

You can use both module in the configuration file.

14.2.4. Running urpmi in Parallel

All previous steps are automatically done if you are using the IGGI distribution.

Ok now let's use it:

urpmi --parallel group_name package

For example, if you want to install distcc on all cluster nodes, just run:

[root@iggi ~]# urpmi --parallel cluster distcc
copy of file  /var/cache/urpmi/partial/parallel.cz
One of the following packages is needed:
 1- distcc-daemon-standalone-2.18.3-2mdviggi.i586 : Program to distribute compilation of C or C++
 2- distcc-daemon-xinetd-2.18.3-2mdviggi.i586 : Program to distribute compilation of C or C++
What is your choice? (1-2) 1
To satisfy dependencies, the following packages are going to be installed:
distcc-2.18.3-2mdviggi.i586
distcc-client-2.18.3-2mdviggi.i586
distcc-daemon-common-2.18.3-2mdviggi.i586
distcc-daemon-standalone-2.18.3-2mdviggi.i586
distcc-masq-2.18.3-2mdviggi.i586
Proceed with the installation of the 5 packages? (0 MB) (Y/n) y

distributing //var/install/cluster/media/main/distcc-masq-2.18.3-2mdviggi.i586.rpm //var/install/cluster/media/main/distcc-daemon-standalone-2.18.3-2mdviggi.i586.rpm //var/install/cluster/media/main/distcc-2.18.3-2mdviggi.i586.rpm //var/install/cluster/media/main/distcc-daemon-common-2.18.3-2mdviggi.i586.rpm //var/install/cluster/media/main/distcc-client-2.18.3-2mdviggi.i586.rpm
copy of file  //var/install/cluster/media/main/distcc-masq-2.18.3-2mdviggi.i586.rpm
copy of file  //var/install/cluster/media/main/distcc-daemon-standalone-2.18.3-2mdviggi.i586.rpm
copy of file  //var/install/cluster/media/main/distcc-2.18.3-2mdviggi.i586.rpm
copy of file  //var/install/cluster/media/main/distcc-daemon-common-2.18.3-2mdviggi.i586.rpm
copy of file  //var/install/cluster/media/main/distcc-client-2.18.3-2mdviggi.i586.rpm
.........

To remove a package, just do the same command just change urpmi with urpme.

[root@iggi ~]# urpme --parallel cluster ntsysv
To satisfy dependencies, the following 1 packages will be removed (0 MB):
ntsysv-1.3.20-4mdk.i586
Remove 1 packages? (y/N) y
removing ntsysv-1.3.20-4mdk.i586

14.3. urpmi recover

urpmi.recover is a tool to help management of RPM rollbacks. It has three main functions:

  • urpmi.recover --checkpoint is used to define a point in your system that you consider stable, and to start storing info that will enable you to rollback installations and upgrades to this state.

  • urpmi.recover --list is used to list chronologically all installa- tions and upgrades on your system.

  • urpmi.recover --rollback is used to roll back installations and upgrades to a previous point in the past (at most until your check-point.)

[root@iggi ~]# urpmi.recover --checkpoint
Cleaning up repackage directory [/var/spool/repackage]...
0 files removed
Writing rpm macros file [/etc/rpm/macros.d/urpmi.recover.macros]...

[root@iggi ~]# urpmi ntsysv

installing ntsysv-1.3.20-4mdk.i586.rpm from //var/install/cluster/media/main
Preparing...                     #############################################
      1/1: ntsysv                #############################################

[root@iggi ~]# urpmi.recover --list-safe
Date                rpms
------------------- -------------------
2006-11-09 10:00:12 ntsysv-1.3.20-4mdk.i586

[root@iggi ~]# urpmi.recover --rollback 2006-11-09
Rollback until 2006-11-09 00:00:00...

Rollback packages (+0/-1) to Thu Nov  9 10:00:12 2006 (0x4552fc2c):
Preparing...                ########################################### [100%]
[root@iggi ~]# rpm -qa ntsysv