United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
A rpm is a package manager that can be used to build, install, query, verify, update, and erase individual software packages.
When rpm is ran with options -q or --query, it will print the names of the packages queried, provided it is installed on the system. The format of the names displayed depends on the QUERYFMT format string. The QUERYFMT format strings specify a format that package information should be printed on. By default, it will print the software name, software version, and package release. The package release consists of the release version, and distribution name.
For example, using the following command on a 64-bit machine:
$ rpm -q zlib zlib-1.2.3-14.fc8
zlib-1.2.3-14.fc8
Displayed are the zlib packages installed. The software name is zlib, software version is 1.2.3, release version is 14, and the distribution name is fc8. It does not look obvious why there are two zlib packages installed. To display the architecture, either change the QUERYFMT format string each time the command rpm -q is run.
$ rpm -q --queryformat="%{name}-%{version}-%{release}.%{arch}\n" zlib
zlib-1.2.3-14.fc8.x86_64
zlib-1.2.3-14.fc8.i386
Or modify the %_query_all_fmt variable in ~/.rpmmacros.
$ echo %_query_all_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH} >> ~/.rpmmacros
$ rpm -q zlib
zlib-1.2.3-14.fc8.x86_64
zlib-1.2.3-14.fc8.i386