|< Day Day Up >|
3.9 RPM management
Red Hat Packet Manager (RPM) is a standard software packaging format in SuSE and all Red Hat-based distributions. 
3.9.1 Naming convention
The RPM naming convention has the following format: name-version-release.arch.rpm. If we take screen-3.9.13-23.ppc.rpm as an example, we see the
3.9.2 Querying RPM
We have two RPM querying possibilities: querying a package we have not installed yet, and querying an installed software package. Most options are the same for both queries, but the command syntax is different. Some options can only be used for one of the queries.
To query a package that is not installed (an RPM file):
rpm -q OPTIONS -p name-version-release.arch.rpm
Always add the -p option for a package that is not installed, as shown in Example 3-21.
Example 3-21. rpm querying rpm-file
# rpm -qi -p screen-3.9.13-23.ppc.rpm Name : screen Relocations: (not relocateable) Version : 3.9.13 Vendor: SuSE Linux AG, Nuernberg, Germany Release : 23 Build Date: Tue Nov 12 01:38:51 2002 Install date: (not installed) Build Host: sweetie.suse.de Group : System/Console Source RPM: screen-3.9.13-23.src.rpm Size : 633585 License: GPL Packager : http://www.suse.de/feedback Summary : Multi Screen on a VT100/ANSI Terminal Description : With this program you can take advantage of the multitasking abilities of your Linux system by opening several sessions over one terminal. The sessions can also be detached and resumed from another login terminal. Documentation: man page Authors: -------- Oliver Lauman Juergen Weigert <email@example.com> Michael Schroeder <firstname.lastname@example.org>
To gather information about installed packages we do not provide the full RPM name with version, release and architecture; instead, we only use the name of the software:
rpm -q OPTIONS name
This is shown in Example 3-22.
Example 3-22. rpm: querying installed rpm package
# rpm -qi rsync Name : rsync Relocations: /usr Version : 2.5.6 Vendor: Red Hat, Inc. Release : 20 Build Date: Tue 05 Aug 2003 03:52:53 PM EDT Install Date: Thu 06 Nov 2003 05:00:36 PM EST Build Host: cure81.devel.redhat.com Group : Applications/Internet Source RPM: rsync-2.5.6-20.src.rpm Size : 263593 License: GPL Signature : DSA/SHA1, Wed 24 Sep 2003 01:24:57 PM EDT, Key ID 219180cddb42a60e Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : A program for synchronizing files over a network. Description : Rsync uses a reliable algorithm to bring remote and host files into sync very quickly. Rsync is fast because it just sends the differences in the files over the network instead of sending the complete files. Rsync is often used as a very powerful mirroring process or just as a more capable replacement for the rcp command. A technical report which describes the rsync algorithm is included in this package.
Table 3-4 lists options for querying RPMs; refer to the rpm man page for more information.
Table 3-4. RPM query options
RPM maintains a database in /var/lib/rpm, and this database grows,
To verify and monitor changes in the system, rpm -V package or a can be used. It uses the database and displays all files changed since installation for the given package, or for the entire system, if the -a option is provided, as shown in Example 3-23 on page 138.
Example 3-23. using rpm -V samba
# rpm -V samba S.5....T c /etc/pam.d/samba S.5....T c /etc/samba/smbpasswd
RPM displays 8
3.9.3 Installing and uninstalling RPMs
If you want to install some third party RPMs, first query them and make sure they apply to your architecture (ppc) or are architecture-independent (noarch), then verify that they can be installed on your distribution.
As for querying, we need a full RPM file name (name-version-release.arch.rpm) if we are going to install it, but we only need the package name (name) if we are uninstalling it. Table 3-5 lists examples for RPM installation and uninstallation.
Table 3-5. RPM installation
RPMs are always distributed as a full package, not as an update package. If for some reason you need to downgrade an RPM to the level you used before upgrading, you need to uninstall it and reinstall the older RPM. If you are not able to uninstall an RPM because of other packages depending on it, use the --nodeps option when uninstalling, and reinstall the older version immediately.
Surprisingly, on SuSE SLES, YaST can be used to install RPMs on the command line, and under some circumstances it resolves dependencies automatically. If you call yast -i shortrpmname it will try to resolve dependencies of the package.
If your system has any
If the system is in good condition and the installation CD (or other directories provided in
) is accessible, then YaST will install the package
If we call yast -i fullpackagename , then YaST will just install the RPM. It acts like rpm -U . It will fail just like rpmif the dependencies of the package are unresolved.
|< Day Day Up >|