12.4. Practical and Common Examples of RPM Usage
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. To verify your entire system and see what might be missing, you could try the following command:
rpm -Va
rpm -Va
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If some files are missing or appear to have been corrupted, you should probably either re-install the package or uninstall and 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, enter:
rpm -qf /usr/bin/ggv
rpm -qf /usr/bin/ggv
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output would look like the following:ggv-2.6.0-2
ggv-2.6.0-2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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 ownspaste
. Enter the following command,rpm -Vf /usr/bin/paste
rpm -Vf /usr/bin/paste
Copy to Clipboard Copied! Toggle word wrap Toggle overflow and the appropriate package is verified. - 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/free
rpm -qdf /usr/bin/free
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output would be similar to the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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 crontabs-1.10-7.noarch.rpm
rpm -qip crontabs-1.10-7.noarch.rpm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output would be similar to the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Perhaps you now want to see what files the
crontabs
RPM installs. You would enter the following:rpm -qlp crontabs-1.10-5.noarch.rpm
rpm -qlp crontabs-1.10-5.noarch.rpm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output is similar to the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
These are just a few examples. As you use RPM, you may find more uses for it.