Red Hat Linux 6.2: The Official Red Hat Linux Reference Guide | ||
---|---|---|
Prev | Chapter 6. Package Management with RPM | Next |
RPM is a very useful tool for both managing your system and diagnosing and fixing problems. The best way to make sense of all the options is to look at some examples.
Let's say you delete some files by accident, but you aren't sure what you deleted. If you want to verify your entire system and see what might be missing, you would enter:
rpm -Va |
If some files are missing, or appear to have been corrupted, you should probably either re-install the package or uninstall, then re-install the package.
Let's say you run across a file that you don't recognize. To find out which package owns it, you would enter:
rpm -qf /usr/X11R6/bin/xjewel |
The output would look like:
xjewel-1.6-1 |
We can combine the above two examples in the following scenario. Say you are having problems with /usr/bin/paste. You would like to verify the package that owns that program but you don't know which package that is. Simply enter:
rpm -Vf /usr/bin/paste |
Want to find more about a particular program? You can find out by entering the following to locate the documentation which came with the package that "owns" that program (in this case ispell):
rpm -qdf /usr/bin/ispell |
The output would be:
/usr/man/man4/ispell.4 /usr/man/man4/english.4 /usr/man/man1/unsq.1 /usr/man/man1/tryaffix.1 /usr/man/man1/sq.1 /usr/man/man1/munchlist.1 /usr/man/man1/ispell.1 /usr/man/man1/findaffix.1 /usr/man/man1/buildhash.1 /usr/info/ispell.info.gz /usr/doc/ispell-3.1.18-1/README |
Let's say you find a new koules RPM, but you don't know what it is. To find out some information on it, enter:
rpm -qip koules-1.2-2.i386.rpm |
The output would be:
Name : koules Distribution: Red Hat Linux Colgate Version : 1.2 Vendor: Red Hat Software Release : 2 Build Date: Mon Sep 02 11:59:12 1996 Install date: (none) Build Host: porky.redhat.com Group : Games Source RPM: koules-1.2-2.src.rpm Size : 614939 Summary : SVGAlib action game; multiplayer, network Description : This arcade-style game is novel in conception and excellent in execution. No shooting, no blood, no guts, no gore. The play is simple, but you still must develop skill to play. This version uses SVGAlib to run on a graphics console. |
Now you want to see what files the koules RPM installs. You would enter:
rpm -qlp koules-1.2-2.i386.rpm |
The output is:
/usr/man/man6/koules.6 /usr/lib/games/kouleslib/start.raw /usr/lib/games/kouleslib/end.raw /usr/lib/games/kouleslib/destroy2.raw /usr/lib/games/kouleslib/destroy1.raw /usr/lib/games/kouleslib/creator2.raw /usr/lib/games/kouleslib/creator1.raw /usr/lib/games/kouleslib/colize.raw /usr/lib/games/kouleslib /usr/games/koules |
These are just several examples. As you use the system you will find many more uses for RPM.