Linux-Mandrake: |
User Guide and |
Reference Manual |
MandrakeSoft
January 2000 http://www.linux-mandrake.com
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.
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.)
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
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.
The package query option is -q
. You can ask RPM a
lot of things:
rpm -q
foo
),
rpm -ql foo
),
rpm -qi
foo
).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
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.
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).
You can see the various options in the radio buttons on the left:
rpm
the
-U
option instead of -i
;
rpm
. If a dependency has not been supplied, the package will
refuse to install. You can force installation by disabling this option
(the equivalent of the --nodeps
option of rpm
), but
here too you have to know what you are doing. A package which has been
installed this way may not work!
--test
of rpm
.After this, click on Install if you want to install it, or on Cancel to cancel the operation.
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).
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.
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.