Linux-Mandrake:
User Guide and
Reference Manual

MandrakeSoft

 
 
January 2000
http://www.linux-mandrake.com


Next : Lothar
Previous : Adding and deleting user accounts
Up

(Back to the table of contents)

Chapter 5 : Installing and uninstalling RPM packages


The program which we will use is rpm (the RedHat Package Manager), a text mode program.

Several graphical versions of rpm are available: Kpackage (a KDE application), GnoRPM (an application for GNOME) and the new Linux-Mandrake application RPMDrake.

On the command line: rpm

This is the simplest and most powerful way: the rpm command not only allows you to install or uninstall packages, it also allows you to see the package dependencies and what a package supplies the others with, and to build packages. But we will restrict ourselves to the most common tasks: installing, uninstalling and obtaining useful information.

Please note that you have to install packages as root. You therefore have to connect as root, or you can also type the command su as a user. The program will then ask you for the root password. If you enter it correctly (always blind), you will then be root:

fg!rtfm $ su
Password:
root!rtfm /home/fg #

(From here on, we will use the regular $ prompt character, whether you need to be operating as root or not.)

Installing or upgrading an RPM

Assuming that you have an RPM called foo-1.0-1.i386.rpm in the directory, you can install it by entering the following command:

$ rpm -ivh foo-1.0-1.i386.rpm

If you want to upgrade a package (for example foo 1.1 has come out), you will have to use -Uvh instead of -ivh.

However, you are not obliged to install it. you can simply test whether the package will be installed: you will have to add the --test option in the line above, which will give:

$ rpm -ivh --test foo-1.0-1.i386.rpm

Uninstalling an RPM

If you want to uninstall foo, you will need to use the -e option of the rpm program:

$ rpm -e foo

You do not need to specify the whole package name. Since the package has been previously installed, it is in the RPM database and is recognized here as foo. A reference to this package is therefore enough.

Obtaining information about RPM packages

The package query option is -q. You can ask RPM a lot of things:

You can even ask if a file in your system belongs to a package, and, if yes, which one. For example, if you want to know which package contains the file /etc/passwd, you simply have to type:

$ rpm -qf /etc/passwd

rpm will reply that this file belongs to the setup package.

Finally, you can obtain information on the packages which have not yet been installed: this is the -p <package_name> options. For example, if you want to know which files the foo-1.0-1.i386.rpm package will install, you will simply have to type:

$ rpm -qlp foo-1.0-1.i386.rpm

With Kpackage

Kpackage is the KDE package management program. This is the program with which KFM associates RPM packages: clicking on an RPM package in KFM will start Kpackage with this RPM, and here you will see the information on the package. Kpackage also supports Drag'n'Drop, and you can drag an RPM from KFM to an existing Kpackage window.

Installing a package

As we have already said, click on a package in KFM, drag an RPM from KFM to an existing Kpackage window or invoke kpackage <name_of_rpm>.i386.rpm from the command line. You will then receive the information on the package (figure 8.1).

Information displayed by Kpackage
Figure 8.1 Information displayed by Kpackage

You can see the various options in the radio buttons on the left:

After this, click on Install if you want to install it, or on Cancel to cancel the operation.

Uninstalling an existing package

Simply bringing up Kpackage will take you to the main window. Here you will see the list of all packages installed on the system in the form of a tree (figure 8.2).

The tree structure of packages installed
Figure 8.2 The tree structure of packages installed

You do not have to search for a package in the tree manually. In the File menu, you can carry out a package search by name (or by a substring). Kpackage will then develop the tree by itself and will highlight the selected package. When you have found the package you want, you will then have to click on Uninstall on the right side of the window.

You can even search by file. However, you will have to indicate the complete path to the file. If, for example, you want to uninstall xv, you can carry out a package search on the executable file (/usr/X11R6/bin/xv); Kpackage will then tell you that the corresponding package is xv. Then do a package search on xv, and Kpackage will find it for you in the tree.

Information on packages

Kpackage provides this information automatically: when you click on an RPM in the tree, the information will appear on the right side of the window: general information in the Properties tab, and the list of files installed by this package in the File List tab. It will give you the same information on a package which you want to install.


Next : Lothar
Previous : Adding and deleting user accounts
Up

Copyright � 2000 MandrakeSoft