justlinux.com
Mon, 13-Feb-2012 13:54:26 GMT

Forum: Registered Users: 75964, Online: 256
nhfs Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home Home

Help File Library: Red Hat RPM Guide

In general, normal usage of the rpm command can be summarised as follows:

Installation/Upgrading/Removal

To install a package type: rpm -ivh
ex. rpm -ivh somepackage.1.1-4.i386.rpm

To upgrade a package: rpm -Uvh [filename]
ex. rpm -Uvh somepackage.1.1-5.i386.rpm

To remove a package: rpm -e [packagename]
ex. rpm -evh somepackage

Also for upgrading or installing some packages you may need to use additional flags to force the install happen. It is only recommended to use these if you know why these flags were needed. --force will overwrite files that are owned by other packages. --nodeps will install even if the package needs packages that were not installed.

To see if a package is installed: rpm -q [packagename]
ex. rpm -q somepackage

To get info on an installed package: rpm -qi [packagename]
ex. rpm -qi somepackage

To list which files belong to a package: rpm -ql [packagename]
ex. rpm -ql somepackage

To see what package a file belongs to: rpm -qf
ex. rpm -qf /usr/bin/some_executable

One can usually join various query commands together, so rpm -qil will give info and list all the files in the package.

To look in a rpm filename that isnt installed, you tag on the p to the query line.
ex. rpm -qilp somepackage.1.1-4.i386.rpm will list the information and the files contained in somepackage.

--More Advanced usages can be found in the man page for rpm and at the web site: ftp.rpm.org

--Verification To see what files on the system may have changed from their initial settings you can use RPM, to check up on them. rpm -Va will give you a list of all files that have changed in one form or another since the package it is associated was installed. This can be a lot of files (and a lot may be changed due to post installation work).

To just see what packages have changed so that you can verify them more individually, you can do the following:
rpm -Va | awk '{print $2}' | xargs rpm -qf | sort -u &> /tmp/file1

Then look in the file /tmp/file1 for which packages have had changes from them.