Package Management through the Command Line

RpmDrake applications are merely graphical interfaces to the powerful urpmi command line tools. For those wishing to control their packages through the command line (useful if you are working remotely, for example) we quickly present the most useful commands. Note that most commands will need root privileges.

Installing and Removing Packages

This is done through two simple commands:

urpmi <package_name>

Will install package package_name if it exists or the package which name contains the package_name string in it.

urpme <package_name>

Will remove the package package_name.

Consult the urpmi(8) and urpme(8) man pages to learn about the many options and behaviors of these two commands.

Media Management

Adding and removing medias is easy on the command line but the syntax must be strictly respected.

Adding a New Media

urpmi.addmedia <name> <url>

This command allows you to add a new media either from a local drive, a removable device (CD-ROM), or from the network through the HTTP, FTP, NFS, ssh or rsync protocols. The syntax varies for each of these methods so you are encouraged to consult the urpmi.addmedia(8) man page before using it.

Tip

If you are declaring a new update media, use the --update option on your urpmi.addmedia command line.

Removing Medias

urpmi.removemedia <name>

This command will simply remove the media name. If you cannot remember the media's name, issuing urpmi.removemedia alone on the command line will list all declared medias.

Updating Medias

urpmi.update <name>

This command will scan the named media and update the package list associated to it. This is useful notably for update medias. If you wish to rescan all known medias you can simply run urpmi.update -a

Tricks and Recipes

Finding the Package that Contains a Specific File

You know you need a specific file on your system but you do not know which package provides it... The urpmf utility will scan all medias and find it for you. Just run urpmf <filename> and the package(s) that contain it will be displayed.

You can even provide only a partial name. For example urpmf salsa will return all packages that contain a file which name contains the salsa name in it.

[root@test peter]# urpmf salsa
kaffe:/usr/lib/kaffe/lib/i386/libtritonusalsa-1.1.x-cvs.so
kaffe:/usr/lib/kaffe/lib/i386/libtritonusalsa.la
kaffe:/usr/lib/kaffe/lib/i386/libtritonusalsa.so
libncbi2-devel:/usr/include/ncbi/salsa.h
libncbi2-devel:/usr/include/ncbi/salsap.h

Updating Packages

This command will automatically update all the packages that need it as mandrakeupdate would do it:

urpmi.update -a; urpmi --update --auto-select --auto