Red Hat Linux 7.0: The Official Red Hat Linux Reference Guide | ||
---|---|---|
Prev | Chapter 5. 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/ghostview |
The output would look like:
gv-3.5.8-10 |
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/md5sum |
The output would be:
/usr/share/doc/textutils-2.0a/NEWS /usr/share/doc/textutils-2.0a/README /usr/info/textutils.info.gz /usr/man/man1/cat.1.gz /usr/man/man1/cksum.1.gz /usr/man/man1/comm.1.gz /usr/man/man1/csplit.1.gz /usr/man/man1/cut.1.gz /usr/man/man1/expand.1.gz /usr/man/man1/fmt.1.gz /usr/man/man1/fold.1.gz /usr/man/man1/head.1.gz /usr/man/man1/join.1.gz /usr/man/man1/md5sum.1.gz /usr/man/man1/nl.1.gz /usr/man/man1/od.1.gz /usr/man/man1/paste.1.gz /usr/man/man1/pr.1.gz /usr/man/man1/ptx.1.gz /usr/man/man1/sort.1.gz /usr/man/man1/split.1.gz /usr/man/man1/sum.1.gz /usr/man/man1/tac.1.gz /usr/man/man1/tail.1.gz /usr/man/man1/tr.1.gz /usr/man/man1/tsort.1.gz /usr/man/man1/unexpand.1.gz /usr/man/man1/uniq.1.gz /usr/man/man1/wc.1.gz |
Let's say you find a new sndconfig RPM, but you don't know what it is. To find out some information on it, enter:
rpm -qip sndconfig-0.48-1.i386.rpm |
The output would be:
Name : sndconfig Relocations: (not relocateable) Version : 0.48 Vendor: Red Hat Release : 1 Build Date: Mon 10 Jul 2000 02:25:40 Install date: (none) Build Host: porky.devel.redhat.com Group : Applications/Multimedia Source RPM: sndconfig-0.48-1.src.rpm Size : 461734 License: GPL Packager : Red Hat <http://bugzilla.redhat.com/bugzilla> Summary : The Red Hat Linux sound configuration tool. Description : Sndconfig is a text based tool which sets up the configuration files you'll need to use a sound card with a Red Hat Linux system. Sndconfig can be used to set the proper sound type for programs which use the /dev/dsp, /dev/audio and /dev/mixer devices. The sound settings are saved by the aumix and sysV runlevel scripts. |
Now you want to see what files the koules RPM installs. You would enter:
rpm -qlp sndconfig-0.48-1.i386.rpm |
The output is:
/usr/sbin/pnpprobe /usr/sbin/sndconfig /usr/share/locale/cs/LC_MESSAGES/sndconfig.mo /usr/share/locale/da/LC_MESSAGES/sndconfig.mo /usr/share/locale/de/LC_MESSAGES/sndconfig.mo /usr/share/locale/es/LC_MESSAGES/sndconfig.mo /usr/share/locale/fr/LC_MESSAGES/sndconfig.mo /usr/share/locale/hu/LC_MESSAGES/sndconfig.mo /usr/share/locale/id/LC_MESSAGES/sndconfig.mo /usr/share/locale/is/LC_MESSAGES/sndconfig.mo /usr/share/locale/it/LC_MESSAGES/sndconfig.mo /usr/share/locale/ko/LC_MESSAGES/sndconfig.mo /usr/share/locale/no/LC_MESSAGES/sndconfig.mo /usr/share/locale/pt/LC_MESSAGES/sndconfig.mo /usr/share/locale/pt_BR/LC_MESSAGES/sndconfig.mo /usr/share/locale/ro/LC_MESSAGES/sndconfig.mo /usr/share/locale/ru/LC_MESSAGES/sndconfig.mo /usr/share/locale/sk/LC_MESSAGES/sndconfig.mo /usr/share/locale/sl/LC_MESSAGES/sndconfig.mo /usr/share/locale/sr/LC_MESSAGES/sndconfig.mo /usr/share/locale/sv/LC_MESSAGES/sndconfig.mo /usr/share/locale/tr/LC_MESSAGES/sndconfig.mo /usr/share/locale/uk/LC_MESSAGES/sndconfig.mo /usr/share/man/man8/pnpprobe.8.gz /usr/share/man/man8/sndconfig.8.gz /usr/share/sndconfig/sample.au /usr/share/sndconfig/sample.midi |
These are just several examples. As you use the system you will find many more uses for RPM.