Red Hat Linux 7.3: The Official Red Hat Linux Customization Guide | ||
---|---|---|
Prev | Chapter 25. Package Management with RPM | Next |
RPM is a useful tool for both managing your system and diagnosing and fixing problems. The best way to make sense of all of its options is to look at some examples.
Perhaps you have deleted some files by accident, but you are not sure what you deleted. If you want to verify your entire system and see what might be missing, you could try the following command:
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.
At some point, you might see a file that you do not recognize. To find out which package owns it, you would enter:
rpm -qf /usr/X11R6/bin/ghostview |
The output would look like the following:
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 do not know which package owns paste. Simply enter the following command:
rpm -Vf /usr/bin/paste |
Do you want to find out more information about a particular program? You can try the following command to locate the documentation which came with the package that owns that program:
rpm -qdf /usr/bin/md5sum |
The output would be like the following:
/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 |
You may find a new RPM, but you do not know what it does. To find information about it, use the following command:
rpm -qip sndconfig-0.48-1.i386.rpm |
The output would look like the following:
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. |
Perhaps you now want to see what files the sndconfig RPM installs. You would enter the following:
rpm -qlp sndconfig-0.48-1.i386.rpm |
The output will look like the following:
/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 a few examples. As you use it, you will find many more uses for RPM.