Aerospace



Home

Company Information

Information Request

Linux How-to Guides

ADSP 21xx
Digital Signal Processing
Tutorials

SW Utilities

On-line Order Form

Aerospace Projects

Commercial Projects

Circuit Boards

Server Support


Bonk

Have you found this site useful? Did we save you time? Did we cure your head-ache? Is your hair growing back now?

Please make a donation to help with maintenance.


Howto URPMI

For Mandrake 9.1, 10.2LE

Herman Oosthuysen

Aerospace Software Ltd.

Copyright 2003, GPL, http://www.gnu.org


General

In Mandrake, the RPM Installer is GUIfied with the Mandrake Control Centre, Software Sources Manager.  Underneath this GUI, lie the programs urpmi, urpmi.addmedia and urpmi.removemedia.

These programs store data in /var/lib/urpmi about all the packages available from your Mandrake installation disks and ftp servers.  These programs ensure that dependencies in the software packages are taken care of when you want to install a package and makes installations and updates a snap.

This is all good and fine, when it works.  When things go wrong though, it can be very painful to figure out how to fix it.  I ran into a problem with my laptop, where no matter what I did, the sources manager only accepted the first CD from the 3 CD set.  Any attempt to add other media resulted in error messages with an 'automatically disabled' result. 

This howto describes a fix for this annoyance, plus a couple other tricks, such as an easy way to make and manage RPM files - the way the Mandrake maintainers do it.


RTFM

First of all, open a console and display the manual page for urpmi.addmedia

  • $ su
  • password
  • # man urpmi.addmedia

Happy reading...


Get a Fix

OK, now that you are back:

  • Insert the first CD in the set.
  • # urpmi.addmedia -h -c -f CD1 removeable://mnt/cdrom/Mandrake/RPMS
  • should allow you add the first CD.

If it complains that CD1 already exists and doesn't want to add it:

  • # urpmi.removemedia CD1

will take care of that problem.  Do the same if you get complaints about CD2 and 3.

Now rinse and repeat with the other two CDs:

  • # urpmi.addmedia -h -c -f CD2 removeable://mnt/cdrom/Mandrake/RPMS2
  • # urpmi.addmedia -h -c -f CD3 removeable://mnt/cdrom/Mandrake/RPMS3

Summary

You should end up with the following files in /usr/lib/urpmi:

  • compssUsers.flat
  • hdlist.CD1.cz
  • hdlist.CD2.cz
  • hdlist.CD3.cz
  • list.CD2
  • list.CD3
  • synthesis.hdlist.CD1.cz
  • synthesis.hdlist.CD2.cz
  • synthesis.hdlist.CD3.cz

If you now start Mandrake Control Centre, Software Sources Manager, it should show CD1, CD2 and CD3 and they should be enabled.  Use the opportunity to delete all remaining dud entries.

Things should now be back to normal and the GUI software installer should see all packages on the three CD set.


Tips

Germ reported a fix for an 'URPMI Data Base Locked' problem in the Mandrake Forum. I thought it may be helpful to add it here:

$ su -
password
# killall urpmi urpmi.update urpme rpm urpmi.addmedia
# rm -f /var/lib/urpmi/.LOCK /var/lib/rpm/RPMLOCK

Then you should be good to go.


Roll your own RPMs

The creation of RPM files used to be Black Magic, steeped in ancient mystery and required Voodoo incantations and sacrifices of rollerball mice to get to work. Fear no more. There is an easy way to make RPM files. The not so well guarded secret is the checkinstall program.

Checkinstall is available from here: http://asic-linux.com.mx/~izto/checkinstall/

Using checkinstall is easy:

  • $ ./configure
  • $ make
  • $ su
  • # checkinstall
  • # rpm -i whatever.rpm

For Perl scripts, there is a similar program called cpan2rpm, available from http://sourceforge.net/projects/cpan2rpm/ on Source Forge.


The Great hdlist.cz Mystery

If you are managing a large system and you want to make an hdlist file for your own set of RPM files, use genhdlist. Essentially, put all your RPMs in one directory, run genhdlist and then do an urpmi.addmedia to make it look like another CDROM.

Genhdlist should be here: /usr/bin/genhdlist

This is a good way to extend the standard distribution and still keep your own RPMs separate, for easy management.


Copy MDK10.2 CDs onto local Hard Disk

If you want to keep all CDs on your local hard disk, then you can either do it as ISOs and treat them like removable media (clunky), or copy the CDs to a big repository (better).

To make a big repository in a partition called /data, copy all the CDs on top of each other, using the -a switch to copy everything with all attributes:

# mkdir /data/mdk10.2le
# cp -a /mnt/cdrom/* /data/mdk10.2le

Rinse and repeat for all six CDs in the distribution. You will end up with a media directory, with a bunch of rpm directories inside: main, main2, main3... main6 and others, as well as a media_info directory full of .cz files.

Use urpmi.addmedia to add the whole lot to the software management system. Do not use names like cd1, since it is likely already in use, I used m1 to m11. The secret ingredient is the --probe-synthesis parameter. It took me a loooong time to figure that out:

# urpmi.addmedia --probe-synthesis -c -f m1 file://data/mdk10.2le/media/main
# urpmi.addmedia --probe-synthesis -c -f m2 file://data/mdk10.2le/media/main2
.
.
# urpmi.addmedia --probe-synthesis -c -f m6 file://data/mdk10.2le/media/main6
# urpmi.addmedia --probe-synthesis -c -f m7 file://data/mdk10.2le/media/contrib
# urpmi.addmedia --probe-synthesis -c -f m8 file://data/mdk10.2le/media/dkms
# urpmi.addmedia --probe-synthesis -c -f m9 file://data/mdk10.2le/media/firmwares
# urpmi.addmedia --probe-synthesis -c -f m10 file://data/mdk10.2le/media/modules
# urpmi.addmedia --probe-synthesis -c -f m11 file://data/mdk10.2le/media/plugins

Now if you run the rpmdrake wizard, m1 to m11 should show up and you can install anything without swapping CDs again.

Note that in the above urpmi.addmedia strings, you can use file:, http: or ftp: with a URL to the RPM repository. Therefore, it is easy to configure a remote server to pick up updates from another remote server and manage them via SSH and urpmi or rpmdrake. This is a very powerful system, once you figured out the syntax. I prefer to set things up with a FTP server, since FTP is more powerful than HTTP for this type of application. That way you can use the same FTP server to install machines using only a CD made from the boot image found on CD1, as described here: http://www.aerospacesoftware.com/auto-ftp-howto.html


Media Syntax Examples

The Urpmi.addmedia wizard can be rather confusing. Here are some examples to help you fix problems.

The Medium strings must look like these two examples for a Penguin Liberation Front FTP mirror:

ftp://ftp.planetmirror.com/pub/plf/mandrake/free/10.2
ftp://ftp.planetmirror.com/pub/plf/mandrake/non-free/10.2

With synthesis path:

hdlist.cz

The Medium strings must look like this for a local file repository:

file://home/mdk10.2le/cd1to6/media/main      

With synthesis path:

media_info/synthesis.hdlist.cz

La voila!


'Hope this helps!

Herman



Copyright © 2005-2008, Aerospace Software Ltd., GPL.