Once your server is installed, you may need to install or uninstall software. Mandriva Enterprise Server 5, offers two options to accomplish this task: the graphical Rpmdrake application (see Section 1.4, “Managing Software with Rpmdrake”), and the command-line tools. The latter is comprised of urpmi to install and upgrade software, urpme to remove RPM packages, urpmf and urpmq to search the RPM databases. These are all the underlying programs behind Rpmdrake.
cp -r /media/cdrom/i586 /data/
urpmi.addmedia "Mandriva - mes5 (Entreprise Server) main" file://data/i586/media/main/ urpmi.addmedia "Mandriva - mes5 (Entreprise Server) non-free" file://data/i586/media/non-free/ urpmi.addmedia "Mandriva - mes5 (Entreprise Server) restricted" file://data/i586/media/restricted/
The main purpose of urpmi is to easily download and install RPM packages. RPM software packages often contain dependencies: urpmi recognizes those dependencies, downloads the required missing packages, and removes conflicting packages.
urpmi fetches the list of available RPMs and the RPMs themselves from a source media. Roughly speaking, a source media is described by a name and a location specified by an URL. Currently supported media types include local drives, removable drives (such as CDs), ISO images, and network 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've configured. In the process, urpmi might ask questions. For example, if some packages need to be upgraded, or if some new (unspecified) packages have to be installed, that operation will require confirmation. If some packages need to be removed (due to conflicts with the requested packages), urpmi will also ask for confirmation. In some cases, urpmi will also propose a choice between different alternatives, usually proposing the “best” package as a default.
This option forces urpmi to only use the specified media, instead of defaulting to all available media. You can also specify a substring of media names for urpmi to select all media containing that substring. For example, urpmi --auto-update --media updates will search updates from all media that have “updates” in their name.
urpmi is only usable when at least one media is defined. Usually, the OS installation procedure configures a predefined set of media, corresponding to the installation method you've selected: installation CDs, an HTTP or FTP server if you've installed from a networked mirror. System administrators often want to add media. To do so, use the urpmi.addmedia program:
urpmi.addmedia [options] <name> <url> [with hdlist]
In this synopsis, <name> is the name of the new media, <url> the URL where the RPMs are to be found, and the “with” parameter optionally specifies where to find the information file that describes the media's contents..
URLs can be
ssh:// (this will use rsync
file://, but instructs
urpmi that the directory is mounted from a
removable media, such as a CD or a
DVD. If the media requires authentication, you
can use the usual URL syntax:
In some cases, if your media points to an external HTTP or FTP server, you might want to use a proxy to access it. Use the --proxy and --proxy-user options (the second one is needed if your proxy requires authentication.)
Some media never change. This is the case, for example, for CD-ROMs. However, other media, typically updates, grow. New RPMs are added and old ones are removed. Therefore, before using them you should instruct urpmi that their contents might have changed.
urpmi.update updates-one updates-two
The easiest way to create
your own media is to let urpmi.addmedia do
it. However, this will work properly only if you have a small
number of RPMs, stored on disk or on a shared
NFS mount. To do this, assuming that your
RPMs are under a directory like
/var/my-rpms, enter the command below:
urpmi.addmedia my-media /var/my-rpms
To create a 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 generates a mirror tree for one or several media.
ROOT/ - media/ |- first/ | `- media_info/ |- second/ | `- media_info/ `- media_info/
The RPMs are placed in the
second subdirectories. Repository metadata
is contained in the top-level
directory. Per-media metadata is contained in the
Per-media metadata consists
hdlist.cz file that contains the
gzipped headers of the media's RPMs, a
synthesis.hdlist.cz file (much smaller than
the hdlist) containing only the information necessary
for urpmi to resolve dependencies, and
pubkey file if the RPMs are
signed (so that urpmi can check that the RPMs it
downloads are signed with the key associated to this
[first] hdlist=hdlist_first.cz name=First supplementary media
In the previous case,
first is the directory name,
hdlist_first.cz is the name of the
hdlist file that will be created (it must end
a human-readable description of the media.
is a useful add-on to urpmi to install packages on many
network hosts. It runs a urpmi command in parallel on a
specified number of hosts. More precisely, the machine you run the
command on (the
server) tests the results on
each machine in the group (the “clients”) one by one,
downloads all necessary packages for all machines in the group,
distributes the appropriate packages to each machine, then calls
urpmi on the machine to do the actual installation.
Install urpmi-parallel-ssh or urpmi-parallel-ka-run on the server machine. The first plugin uses plain ssh to distribute commands to other hosts, while the second one uses ka-run, an efficient parallelization method on top of any remote shell (rsh or ssh), adapted to clusters.
On this line,
mynetwork is the name of the alias you will
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 host names of all clients on your network. You
localhost in this list.
urpmi --parallel mynetwork package_name
urpmi has a more
secure counterpart: rurpmi. It is similar to
urpmi, but has a stripped-down set of features. It's
intended to be used by users without
privileges, but with sudo rights on it,
preventing any abuse of this tool to compromise the system.
Its syntax is similar to urpmi, but it prevents installing arbitrary RPMs. They need to come from a registered media. A number of dangerous options, listed in the rurpmi(8) manpage, are also forbidden.
urpme <list of package names>
Note that urpme isn't able to detect packages that are no longer used. For example, libraries not used by applications. To clean them up, a handy tool is rpm-find-leaves. It will list all RPMs on your system that no other package requires.
urpmf is a grep-like tool for the urpmi database (the database of all RPMs in the media). By default, it will search through the file names contained in packages, but a variety of options allows more advanced searches.
urpmf --name '^apache-'
urpmf --provides -f mail-server
urpmq -i package
urpmq --source package
urpmq -d package
The urpmi set of tools is command-line based. You can also use a graphical tool called Rpmdrake. It consists of different components which you access by choosing one of the entries of the + + menu in the main menu, or by clicking on Software Management in the Mandriva Linux Control Center.
The upper part of the window allows you to manipulate the list of packages you can install. This list is in the middle-left of the window. On its right is an area where the currently selected package is described. At the bottom of the window are two buttons and information about the space required to install the selected packages, as well as how much space is available on your disk.
In Figure 5.5, “The Software Package
Installation interface”, the
samba-3.2.7-0.3mdv2009.0 package is
selected in the tree-view. In the package-description are shown
the required disk space, a short summary (“Samba
(SMB) server programs”), as well as a detailed description.
software medium repository is configured to use complete
package lists (not the summary
The status bar displays the disk space required by the selected packages, as well as the current free space. Please note that due to dependencies, the disk space required by the selected packages might be greater than the size required by the chosen package itself.
Now you can begin the installation by clicking on the button. A new window appears, showing you a progress bar of how your installation is proceeding. If you prefer to leave without doing anything, click the button.
While selecting applications to install, it may happen that you choose a package which requires dependencies (additional libraries or another tool) to work correctly. In this case, Rpmdrake displays an information window enabling you to choose whether to accept the selected dependencies, or to the operation (Figure 5.6, “Rpmdrake Dependency Alert Box”).
Let's say you want to install a package which requires dependencies, and various packages are capable of providing that dependency. The list of alternatives is then presented. You may read the additional information presented by clicking the button to help you choose the best alternative.
To search for a specific package, just type its name (or part of the name) in the text area next to the button. Then choose from the pull-down list where you want to look for it (either in the package name, in the description provided with the package or in the names of the files stored in the packages). After clicking on the button, a new list appears (Search results), showing you the results Rpmdrake found while scanning the package databases.
Shows the list of packages in the four groups you saw during the installation process. This is the easier sort order because it focuses on a selected part of the available packages: those considered to be the most useful.
Displays packages alphabetically and under the name of the data medium they belong to (see Section 1.4.4, “The Software Media Manager”).
This interface works like the “Install Software” one, so we won't repeat its basic functions (Section 1.4.1, “Install Software”).
The other difference is a new text section (“Reason for update”) inside the package description area. It tells you why this update was made available. This may help you decide if you want to update certain packages or not. When you have a slow Internet connection or you have to pay per MB when you are downloading, it would be wise to read it.
This part of Rpmdrake is dedicated to the configuration of the package media repositories. As you can see in Figure 5.7, “The Software Media Manager”, some media are configured: “Main”, “Contrib”, etc. With this tool you can add other software media: a CD from a magazine containing RPMs, a Web repository, etc.
This box must be checked for update media, that is, media that contain updates of packages that are already installed on your machine, but with an older version number. Therefore only update media are taken into account when looking for updates.
Permits you to add all publicly available official package sources from Internet repositories. This is useful if you have a fast Internet connection or you only have the first installation CD at hand. Choosing a mirror geographically near to your location is recommended.
Shows a list of already defined media. With it, you can choose the ones from which you want to update the list of available packages. This is useful for remote media to which new packages are being added. Just start the process by clicking on .
It is important that any new package you install is authenticated. To do so, each package can be electronically signed with a “key”, and you can allow/disallow keys on a per-medium basis. In Figure 5.8, “Managing Keys ”, Mandriva Linux key is allowed for medium Installation CD. Click on to allow another key for the selected medium, and on to remove a key from the selected medium.
If you are sitting behind a firewall and you still need to access remote media (especially for package updates), you can do so if you have a proxy server which leads to the Internet (at least in an area where you can find a package server). Normally, it should be enough to fill in the Proxy hostname to get it working (Figure 5.9, “Configuring a Proxy server”). If you need a user/password combination to get through the proxy, you can also specify it here. Just confirm your changes by clicking and you're done.
run a large network of computers, you may want to install a
package on all the computers in parallel. This button opens a
dialog window allowing the configuration of the
“Parallel” mode. See the
urpmi(8) manpage for more
|For advanced users|
By using Rpmdrake's parallel mode, you can
define groups of machines to install the same software packages
on. This greatly simplifies managing a large number of systems,
such as in a LAN. Make sure
urpmi-parallel-ka-run are installed.
Click on , provide a Name for the group, select the Protocol to use (ssh in our example), check the networks to be scanned for hosts in the list or add other networks. By default, only your local network is listed. Then click on .
the network must have an ssh server running and the
corresponding ports (
urpmi --parallel <group_name> <package_name>
urpme --parallel <group_name> <package_name>