Mandriva

RPM III

Summary:

  • urpm - RPM Mandriva Style
  • Configuring urpm
  • Using rpmdrake
  • Using urpm
Section index - KB index

urpm - RPM Mandriva Style

Mandriva'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

Configuring urpm

The best way to learn how to use urpmi is to go to http://urpmi.org

There you will find a series of articles on how to configure and to use it :

Configuring urpmi is easy, using web interfaces that generate the commands for you : A description of the media system underlying the urpmi tool may be found there http://www.zebulon.org.uk/ICML1.HTML

A medium is any support that contains software packages (rpm files) ready to be installed on your system. 3 different types of media exist :

  • removable : these are usually CDs (Installation CDs are automatically added to the urpm base after installation), but can also be Zip, floppies, tape.
  • local : it can be a directory located on your hardrive, where you have copied software packages (rpm files). You will need this kind of medium only if you do not have direct internet access on your linux computer but copy the files from another computer via an usb stick or a floppy disk.
  • distant server : they may be FTP or HTTP servers. This is the most abundant medium : all official Mandrake packages are available on FTP mirrors. Most third-party Mandrake contributors also offer their software by FTP.
In other words, a medium is a rpm repository for Mandrake, where software can be searched, downloaded and installed using only one command : urpmi.

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 see what resources you have defined, run (as 'root'):

urpmq ––list-media

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

urpmi.removemedia resource_name

section index

Using rpmdrake

Rpmdrake is the graphical frontend of urpmi. If you don't want to use the console to install software with urpmi, this tool is for you 1.1 Despite urpmi has more options when used in console, rpmdrake is still very powerful to browse, search, install and remove packages.

A description of Rpmdrake with screenshots is available here : http://www.zebulon.org.uk/ICML0.HTML

http://www.zebulon.org.uk/snapshot90s.png http://www.zebulon.org.uk/snapshot72s.png

Moreover, media management is very easy, using the graphical interface :

http://www.zebulon.org.uk/snapshot47es.png

Also, Mandrake Update is a graphical tool to update the system (security updates, bug fixes...)

http://www.zebulon.org.uk/snapshot34s.png

Using urpm

If you want to use the command line to manage, install and remove your software instead of the rpmdrake graphical interface, this part is for you 1.1

'urpm' consists of a set of command-line 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<br> 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 '~park-rpmdrake' package on your Mandrake CD. This package allows network administrators to deploy Mandrake Linux updates over a multitude of clients without much hassle.

Updating the kernel

Updating the kernel is a different procedure than regular packages updates. It is not difficult, but requires using a console command.

Several resources describing the updating process are available :

section index

Next Item: RPM FAQ


Related Resources:

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

Revision / Modified: May. 28, 2004 / May 17, 2002
Author: Tom Berger/The Wiki community

Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.

KB - RPM III
Version 1.20 last modified by olorin_ on 16/03/2007 at 23:53

 


en fr

RSS

Creator: AdminWiki on 2004/03/22 09:44
(c) Mandriva 2007
18888888