Jump to content

RPM-02: How to use Urpmi & solving dependencies

Recommended Posts

Browse: [About the FAQ Forum] [Table of Contents] [FAQs] [Contribute] [RPM: About RPM usage (urpmi, rpmbuild...)]


RPM-02: How to use Urpmi & solving dependencies


I know many people out there pull out there hair with RPMs.

They can be so easy if you know what to do.

The first thing you should do is setup urpmi


1) Urpmi

Urpmi is the Mandrake Package management tool. It's job is to make the installation and removal of RPMs (see glossary) simpler.

It does this by, 1 having repositories or sources where all the rpms are and secondly by automatically getting all of the rpm's a program requires


To use urpmi, open a command line and su to root*, then:


[root@localhost]# urpmi program


[root@localhost]# urpmi xmms
[root@localhost]# urpmi bluefish

* - To su to root: type 'su' (no quotes) and hit enter

type in your root password when you are prompted to, note that the cursor will not move, and hit enter.


However urpmi is only capable of doing this if you add sources.


The easiest way is Easy URPMI.


a] To use Easy URPMI, point your browser here: easyurpmi.zarb.org (or local mirror www.mandrivausers.org/easyurpmi).


b] Select your version of Mandrake in the first dropdown. Then select your CPU architecture in the second. If you are unsure, pick i586.


c] For each of the dropdowns, select the location nearest to you then check the checkbox next to the dropdown. Once you have done this, click 'Proceed to step 3'


d] Open any command line (konsole, aterm, rxvt, gnome-terminal) and copy the things in the black box into the command line. Do this by selecting it and middle mouse clicking or left and right click at the same time in the command line. Hit enter.


Congratulations, you have now added an urpmi source.

2) other rpm sources

Not all the time are we lucky enough to have our favourite XYZ program or a particular ABC rpm that we need in our sources. In these terrible times we need to visit the following web sites.


a] http://www.rpmseek.com

b] http://www.rpmfind.net

c] http://rpm.pbone.net

d] http://www.google.com

When using these sources try to get a Mandrake rpm for your version of Mandrake. If there isnt one and there is a cooker (see glossary) one, get that or the nearest version of mandrake. As for src.rpms (Source rpms) avoid them, unless you know what they are and how to use it. See below for instructions.


We found rpm XYZ on one of the above sources, now what do we do with it?


[joe@localhost]$ su
[root@localhost]# urpmi /home/joe/downloads/XYZ1.2-3.i586.rpm

Usually we will be lucky and all of rpm XYZ's dependencies will be in the sources and it will install. But today, we aren't lucky


[root@localhost]# urpmi /home/joe/downloads/XYZ1.2-3.i586.rpm
error: Failed dependencies:
        ABC = 9.8.7 is needed by XYZ1.2-3.i586.rpm

So we need to go and get ABC from our sources. If we are unfortunate we might enter dep_hell (see glossary).

Other times we might get this response:


[root@localhost]# urpmi /home/joe/downloads/XYZ1.2-3.i586.rpm
error: Failed dependencies:
        ABCDEF.so.0 = 9.8.7 is needed by XYZ1.2-3.i586.rpm

How do we know what package ABCDEF.so.0 is in? COuld be anything from libABC to libXYZ, so we go and ask rpmseek. www.rpmseek.com


We select 'Package Contains File' then put ABCDEF.so.0 in the search box.and select an appropriate rpm from the list given to us.

3) Updating & Upgrading

You've finally got all the software you want but it's been a few weeks/months since you installed it all. To update it all, all you need to do is


[root@localhost]#  urpmi --auto-select

This however may give you some complaints about GPG signatures(see below) on the files.

To automatically ignore this, instead of the above use:


[root@localhost]#  urpmi --auto-select --no-verify-rpm --auto

To upgrade to the next version of Mandrake without using the installer, remove your sources and add new sources for the next version of Mandrake. Then perform the above command and the below command. This can sometimes mess up the system and often causes bloat by installing many extra packages.

[root@localhost]#  urpmi kernel

Excluding Packages


If you are upgrading versions of Mandrake through urpmi (not really recommended, but it can be done) or you are running a 'bleeding edge' cooker system that you update frequently, you may run into a package or packages that are broken. This happened to me recently with a package in cooker. In my case, and probably yours as well, installing the earlier version of the package cured the problem. Because of this, I want to exclude that package from further urpmi --auto-select commands. This is pretty easy to do. You need to be root, so open a terminal and su to root. You will need to edit the file /etc/urpmi/skip.list Use your favorite text editor to do that. It's pretty self-explanatory. You just add the packagename, or the begining name of the package like this:



And so on. Save the file and the next time you run your update, those packages will be excluded from the file listing.


- Section added by LiquidZoo


4) Glossary

GPG signatures: Often you will be asked whether or not to install an RPM because urpmi can't verify the signature. Most of the time this its fine to install it. I always do.



The Red Hat Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like.


Source RPM

A source rpm is just like a standard RPM except it contains the Source code of an program/package. TO use these the appropriate development packages such ass GCC, and any development libraries must be installed. You can use a source rpm with the following command:

[root@localhost]# rpm --rebuild foo.src.rpm

A rpm will be generated and put into /usr/src/RPM/RPMS/i586/ for installation by urpmi or by rpm -ivh.



Dep hell is when an rpm requires another rpm which requires another one.... and on it goes or a particular required rpm is hard to find. Resolving dep_hell situations can often be futile, slow and painful.


Should you need any more help feel free post on the board here.

Any questions about this FAQ should be sent to me via PM (Private Message) or emailed to me, iphitus, at iphitusau@yahoo.com.au


Good Luck!!!



Link to comment
Share on other sites

RPM-02: How to use Urpmi & solving dependencies - Advanced


Ok, now that we're familar with how to use urpmi, it's time for some more advanced topics. The topics that will be covered here:

  • Updating urpmi sources (after they are already entered)
  • Easier urpmi for dial-up users
  • Adding your own sources to urpmi

Updating urpmi sources


This one's easy. Open a console, su to root and enter

[ liquidzoo ]# urpmi.update -a

This will update all of your sources (esp ones that you get from the net. update_source, plf, etc)


Easier urpmi for dial-up users


Once you get the urpmi source from easyurpmi.zarb.org (or local mirror www.mandrivausers.org/easyurpmi), you will get something like this in step 3

urpmi.addmedia plf http://mandrakeusers.com/PLF/mandrake/9.2 with hdlist.cz

After you paste that in your console, but before you hit enter, change it to look like this:

urpmi.addmedia plf http://mandrakeusers.com/PLF/mandrake/9.2 with synthesis.hdlist.cz

This will download the (much smaller) systhesis file instead of the regular hdlist file. The synthesis file includes the RPM list that's in the hdlist.cz file, it just does not include things like the changelog that take up a lot of space. Should be much easier on the dial-up connection. You can do this with a broadband connection as well if you like.


Adding your own sources to urpmi


Ok, so you have a bunch of RPMs downloaded and you want to add them to a urpmi source, or burn them to a cd for that purpose for your friend on dial-up? Not a problem. Make sure they're in a folder. For our purposes here, we'll call the folder /home/liquidzoo/rpms


After all of the rpms are in this folder, open up a console and su to root. From that point, simply type

[ liquidzoo ]# genhdlist /home/liquidzoo/rpms/

This will take a while to run, but after you've finished you can burn the whole folder to a cd and have the hdlist there too.


Now, we've created the hdlist, how do we add it you may ask. Easy. There are 2 ways to do this. From your hd, or from a cd. Here's the code for both. Remember, you have to do this in a console as root:

From your Hard Drive:

[ liquidzoo ]# urpmi.addmedia myrpms file:///home/liquidzoo/rpms with hdlist.cz

Notice the 3 /'s. That's important.

Now for your friend from a cd, assuming the cd is /mnt/cdrom and the folder is still rpms/:

[ liquidzoo ]# urpmi.addmedia myrpms removable://mnt/cdrom/rpms with hdlist.cz

This time there's only 2 /'s.


Don't forget, if you do this from hd, and you add more rpms to the folder, you need to re-run the genhdlist command.

Link to comment
Share on other sites


  • Create New...