Software packages often depend on each other; urpmi is able to recognize those dependencies, to download missing required packages as needed, and to remove conflicting packages if it needs to.
urpmi gets the list of available RPMs, and the RPMs themselves, from a media. Roughly speaking, a media is described by a name and by a location, specified by an URL. Currently supported media types are: local drives, removable drives (such as CDs), ISO images, and networked media via different protocols (http, ftp, ssh and rsync). NFS mounted directories are treated like local drives.
urpmi <list of package names>
That prompts urpmi to fetch and install all packages and their unmet dependencies from the media you have configured. In the process, urpmi might ask a few questions. Notably, if some packages need to be upgraded, or if some new (unspecified) packages should be installed, it will ask for confirmation. If some packages need to be removed (due to conflicts with the requested packages), urpmi will ask for confirmation as well. In some cases, urpmi will also propose a choice between different alternatives, usually proposing the ``best'' package as a default.
Another very useful mode of action for urpmi is to ask it to upgrade all packages to the latest version found on the media. This is done by
urpmi can also help installing RPM files directly. Instead of using "rpm -i foobar.rpm", you can pass the path to the rpm file to urpmi: it will then try to resolve the needed dependencies.
Useful options to urpmi include:
urpmi --auto-update --media updates
will search updates from all media that have ``updates'' in their name.)
See the urpmi(8) manpage for the complete reference of all options that urpmi supports.
urpme <list of package names>
will attempt to remove all listed packages, plus the packages that depend on them. It will refuse to uninstall ``important'' packages (that is, the ones that are part of the base system.)
See the urpme(8) manpage for the reference of all options urpme supports.
urpmi.addmedia [options] <name> <url>
In this synopsis, "<name>" is the name of the new media, "<url>" the URL where the RPMs are to be found.
Supported URLs can be "http://", "ftp://", "rsync://", "ssh://" (this will use rsync over ssh), "file://", and "cdrom://". If the media requires authentication, you can use the usual URL syntax:
Those credentials won't be stored in any world-readable file.
In some cases, if your media points at an external HTTP or FTP server, you might want to use a proxy to access it. This is possible by using the "--proxy" and "--proxy-user" options (the second one in case of your proxy requires authentication.)
To do this, use the urpmi.update program. You can either update all media:
or update only media specifically named:
urpmi.update updates-one updates-two
urpmi.addmedia my-media /var/my-rpms
However, to create media containing a large number of RPMs, or to be put on a shared server, you'll need to use the gendistrib tool. It comes in the "rpmtools" package. It is able to generate a mirror tree for one or several media.
A typical media repository, under a root directory /ROOT/, has the following structure: (here, we have two media, named "first" and "second")
ROOT/ - media/ |- first/ | `- media_info/ |- second/ | `- media_info/ `- media_info/
The RPMs are place in the "first" and "second" subdirectories. Repository metadata is contained in the top-level media_info directory. Per-media metadata are contained in the first/media_info and second/media_info subdirectories.
Per-media metadata consists in an "hdlist.cz" file, that contains the gzipped headers of the RPMs in the media, a "synthesis.hdlist.cz" file, much smaller than the hdlist and that contains only the information necessary to urpmi to resolve dependencies, and optionally a "pubkey" file if the RPMs are signed (so urpmi can check that the RPMs it downloads are signed with the key associated to this media.)
Before using gendistrib, you must create a file media_info/media.cfg to describe this media repository. The syntax of this file is reminiscent of .ini files. It contains one section per media: for example,
[first] hdlist=hdlist_first.cz name=First supplementary media
Here, "first" is the directory name, "hdlist_first.cz" is the name of the hdlist file that will be created (it must end with ".cz"), and "name=" gives a human-readable descriptive name for the media.
Then, you can run gendistrib. It should be passed the /ROOT/ directory as parameter. It will then generate the hdlist and synthesis files and all other files needed for proper repository operation.
For further information, see the gendistrib(1) manpage.
For example, to find all packages that begin with ``apache-'':
urpmf --name '^apache-'
(the ^ being the beginning-of-line anchor used in standard regular expressions.)
To find all packages that contain files whose pathname includes /etc/httpd.conf.d:
To find all packages that provide ``mail-server'', with their version and release number (-f):
urpmf --provides -f mail-server
See the urpmf(8) manpage for more examples and the list of all options.
urpmq -i package
will list the information for that package (like "rpm -qi" would do for installed packages.) The "--summary" option is similar, but gives only one-line concise information.
urpmq --sources package
will give the URL from which the package can be retrieved.
urpmq --requires-recursive package
will give the list of all RPMs that are required by the specified package (recursively).
Inversely, the command
urpmq --whatrequires package
will give the list of all RPMs that require the specified package.
See the urpmq(8) manpage for the list of all options.
urpmi must be installed on all client machines, but it is not necessary to have media defined on these.
To use it, follow those steps:
On this line, "mynetwork" is the name of the alias you'll use to specify the network to urpmi, "ssh" is the install method (to use "ka-run", look up the entry for /etc/urpmi/parallel.cfg in urpmi.files(5)), and hostN are the hostnames of all clients on your network. You can put "localhost" in this list.
urpmi --parallel mynetwork package_name
Its syntax is similar to the one of urpmi, but it disallows installing arbitrary RPMs: those are forcibly downloaded from a registered media. A number of dangerous options, listed in the rurpmi(8) manpage, are also forbidden.