MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

*DocIndex - GNU/Linux Basics

RPM III

* urpm - RPM Mandrake Style
* Configuring urpm
* Using urpm

Related Resources:

man urpmi
man urpmi.addmedia
man urpmi.removemedia
man urpmi.update
man urpmf
man urpmq

Revision / Modified: Mar. 15, 2002 / May 17, 2002
Author: Tom Berger

 

* urpm - RPM Mandrake Style

Mandrake's 'urpm' ('User RPM') - introduced in ML 7.0 - tackles several RPM weaknesses:

  • It provides a system of automatically solving dependencies by offering to install or uninstall dependent packages. RPM only tells you which files are missing or which packages would be broken.
  • It stores a full dependency set of any given location. RPM only stores data of locally installed packages.
  • If configured, it fetches packages from the Net upon installation, if they are newer than the packages on the installation media (introduced in 8.0).
  • It supports 'installation on demand'. RPM has no such feature.
  • It allows globbing of archive names, easier and more extensive package queries, automated updates and more.

'urpm' isn't meant as a replacement for RPM, it is meant to make common RPM tasks easier. In many parts it resembles the package tool the of the Debian GNU/Linux distribution, 'apt'.

This page refers to 'urpm' as of ML 8.1.

* section index * top

* Configuring urpm

The central configuration file is '/etc/urpmi/urpmi.cfg', the flat text data files are located in '/var/lib/urpmi', the log files in '/var/log'.

When you've installed your system from CDs, these will most likely already be indexed by 'urpm'. To add more installation media (other CDs, local directories, remote directories), use 'urpmi.addmedia'. Let's say you have a local 'rpms' directory in your home directory where you keep downloaded RPMs. To add this directory to the urpm database, run (as 'root'):

urpmi.addmedia local file://home/user_name/rpms

'local' is the nick name under which this resource can be referred to in the future. Update the data base with the data from the new 'local' resource:

urpmi.update local

Now the packages in 'rpms' are part of the urpm database and taken into account during all urpm operations. Don't forget to run 'urpmi.update' if the content of that directory changes (the same goes for all resources with non-static content like FTP directories).

Notice that for remote package resources you have to provide the relative path to the Mandrake Linux 'hdlist.cz' file on that server (relative from the directory where the RPMs are, that is) in the 'base' directory. This means you can't add remote resources to urpm unless they provide that dependency file.

To remove a resource from urpm, run (as 'root'):

urpmi.removemedia resource_name

* section index * top

* Using urpm

'urpm' consists of a set of tools, each performing a certain task (in contrast to 'rpm', which works entirely via options).

Installing And Removing Packages

These commands require 'root' privileges.

To install a package available on one of the configured resources, run

urpmi archive

E.g. to install the 'mc' package:

urpmi mc

'urpmi' will check if this package is available and either download it (if it's on a remote resource) or prompt you for the removable medium the package is on or simply install it from the hard disk. If the package needs other packages, 'urpmi' will ask you if it is OK to install these, too. If you don't want to be asked, add the '--auto' option.

In case the archive name you provide is ambiguous, urpmi will print a list of all matching archive names and exit. You can modify this behavior by using the '-a' option:

urpmi -a gtk

for instance will install all packages whose archive names contain the string 'gtk'.

Another useful option is '-p' which allows to filter packages by what they provide. Example: Let's say you know you need the 'libe2p.so.2' program library, but you do not know which package provides that library:

urpmi -p libe2p.so.2

makes urpmi check which package provides that library and install that package, in this case 'libext2fs2'.

Of course, you can also use it to simply install a local package like you would do with 'rpm -U'. Notice that 'urpmi' always upgrades if it finds an earlier version of the package which is to be installed. Sometimes this is not the behavior you want, e.g. when installing a new kernel or when you need two different versions of the same program library. In these cases, you must use 'rpm -i'.

To uninstall packages, you use 'urpme':

urpme archive

If uninstalling the package would break dependencies of other packages, 'urpme' asks if these should be removed, too. If you don't want to be asked, add the '--auto' option. You should only use this option if you are pretty sure what you are doing ...

'urpme' also accepts the '-a' option:

urpme -a gtk

removes all installed packages whose names contain the string 'gtk'.

Querying Packages

Another area where the 'urpm' system really shines is querying, since the 'urpm' database does also contain information about packages which are not installed. The 'urpm' query tool is 'urpmf'. 'root' privileges are not required.

urpmf file

lists all packages in its database which contain file.

'urpmf' supports a lot of options which allow to query certain fields of package information. You want to know what packages containing games are available?

urpmf --group Games

How big is the 'pingus' package?

urpmf --size pingus
pingus:size:11026299

What is this package about?

urpmf --summary pingus
pingus:summary:Pingus - A free Lemmings clone

Have a look at man urpmf for more query options.

There's another urpm query command called 'urpmq', which is only of limited interest, though.

urpmq string

lists all known archive names which contain string. Globbing patterns are not allowed.

urpmq --sources archive

tells you on which resource archive is located. This command requires 'root' privileges.

urpmq -d archive lists all packages archive depends on and urpmq -r archive prints the full package name of archive.

Other options are listed in man urpmq.

Getting Updates

The urpm system allows you to update your system with the latest security and bug fixes by MandrakeSoft via the command line or even automatically, provided you have added at least one Mandrake Linux mirror to your 'urpmi.cfg' with 'urpmi.addmedia' (actually this is very convenient to do via the Software Manager, so you might want to it at least for this task).

The updating command is very simple

urpmi --auto-select

checks all configured resources for updated packages, lists them and asks if they should be installed. If you don't want to be asked, add the '--auto' option. This option is also convenient when you want you want to run the update via a cron job. Do not forget to run 'urpmi.update' to refresh the resource database.

You can put certain packages on 'hold', i.e. to be ignored by the update command. For this, add the archive names of these packages to the file '/etc/urpmi/skip.list'. For instance, to prevent 'urpmi --auto-select' from installing newer kernel or glibc packages:

kernel
glibc

Mandrake Linux 8.2 introduced '/etc/urpmi/inst.list' which lists all packages which should be installed rather than upgraded. It is preconfigured to automatically exclude all kernel RPMs.

If you have to provide updates for a larger network, have a look at the 'MandrakeUpdateRobot' package on your Mandrake CD. This package allows network administrators to deploy Mandrake Linux updates over a multitude of clients without much hassle.

* section index * top

* RPM FAQ


 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.