Академический Документы
Профессиональный Документы
Культура Документы
RPM (the Red Hat Package manager) is the most widely-used package manager on Linux systems. Other package
formats exist on various Linux systems, such as the Debian (.deb) package format, but the majority of distributions
use the RPM package format. As with any other format, it has unique strengths and weaknesses. One of RPM’s
strengths is the variety of options it provides to verify file information, reset file information, and so on. All of this
information is stored in the RPM database which keeps track of information such as file sizes, md5sums of files,
ownership, permissions, and more.
To obtain a list of all the installed RPM packages on your system, use:
To simply list the filenames, omit the -v option. To verify that the permissions and ownership of the files that were
installed are similar, use the -V option:
# rpm -V sudo
S.5....T c /etc/sudoers
Here you can see that the file, /etc/sudoers, has changed in size, the md5sum has changed, and the modification
time has changed (indicated by S.5….T). However, the c indicator means that this file is a configuration file, so
changes are to be expected.
This will indicate what files have changed from what the package originally provided.
If you wanted to know what configuration files a RPM package provided, use:
The RPM program also provides two very useful switches that can be used to restore ownership and permissions
to files that it is aware of. For instance, if you were to accidentally execute something along the lines of chown -R
user:user /, your system would break very quickly. However, the damage can be mitigated somewhat by restoring
ownership and permissions of files that came in RPM packages by using:
As you can see, there are definitely some interesting things that can be done with RPM. The database stores a fair
amount of information that can be used to query and restore permissions and ownership of files that were provided
in RPM packages.
Delivered each Tuesday, TechRepublic’s free Linux NetNote provides tips, articles, and other resources to help you
hone your Linux skills. Automatically sign up today!