How to use RPM Commands

How to use RPM Commands

This is a post cointain some basic rpm commands to manage RPM packages.

1. Install a RPM package - you can use the command:
# rpm -ivh somepackage.arc.rpm

2. Uninstall a RPM package - you can use the command:
# rpm -e packagename
# rpm -e horde (e.g.)

3. Upgrade a RPM package - you can use the command:
# rpm -Uvh somepackage.arc.rpm
Note: When this command is used, RPM will uninstall the old version of package and install the new version.

4. Query a RPM package - you can use the command:
# rpm -q packagename
E.g.:
[root@box ~]# rpm -q glib
glib-1.2.10-15
Note: rpm -q command will print the package name, version, and release number of installed package. You can use this command to verify that a package is or is not installed on your system.

5. Package information - you can use the command:
# rpm -qi package
E.g.:
[root@box ~]# rpm -qi glib
Name : glib Relocations: (not relocatable)
Version : 1.2.10 Vendor: CentOS
Release : 15 Build Date: Tue Feb 22 05:32:17 2005
Install Date: Tue Mar 28 01:14:49 2006 Build Host: guru.build.karan.org
Group : System Environment/Libraries Source RPM: glib-1.2.10-15.src.rpm
Size : 321141 License: LGPL
Signature : DSA/SHA1, Sat Feb 26 20:42:07 2005, Key ID a53d0bab443e1821
Packager : Karanbir Singh
URL : http://www.gtk.org
Summary : A library of handy utility functions.
Description :
GLib is a handy library of utility functions. This C library is
designed to solve some portability problems and provide other useful
functionality which most programs require.

GLib is used by GDK, GTK+ and many applications. You should install
th glib package because many of your applications will depend on this
library.

As you can see, this command display package information, including name, version, and description of the installed program.

6. List files in package - you can use the command:
# rpm -ql package
E.g.:
[root@box ~]# rpm -ql glib
/usr/lib/libglib-1.2.so.0
/usr/lib/libglib-1.2.so.0.0.10
/usr/lib/libgmodule-1.2.so.0
/usr/lib/libgmodule-1.2.so.0.0.10
/usr/lib/libgthread-1.2.so.0
/usr/lib/libgthread-1.2.so.0.0.10
/usr/share/doc/glib-1.2.10
/usr/share/doc/glib-1.2.10/AUTHORS
/usr/share/doc/glib-1.2.10/COPYING
/usr/share/doc/glib-1.2.10/ChangeLog
/usr/share/doc/glib-1.2.10/NEWS
/usr/share/doc/glib-1.2.10/README
Note that this command will list all files in a installed RPM package. So it only works when the package is already installed on your system.

7. Check a RPM signature package - you use the command:
# rpm --checksig package
Note: This command will check the PGP signature of specified package to ensure its integrity and origin, it is secure to verify that ;)

0 Comments: