I know how to use rpm to list the contents of a package (rpm -qpil package.rpm
). However, this requires knowing the location of the .rpm file on the filesystem. A more elegant solution would be to use the package manager, which in my case is YUM. How can YUM be used to achieve this?
Linux – How to list the contents of a package using YUM
fedoralinuxpackage-managersrpmyum
Related Topic
- Linux – How to recursively find and list the latest modified files in a directory with subdirectories and times
- Linux – How to change the output color of echo in Linux
- Node.js – How to update NodeJS and NPM to the next versions
- How to install Maven with Yum
- Linux – How to find all files containing specific text on Linux
- Node.js – How to list npm user-installed packages
- Linux – How to extract the contents of an rpm
Best Answer
There is a package called
yum-utils
that builds on YUM and contains a tool calledrepoquery
that can do this.Combined into one example:
On at least one RH system, with rpm v4.8.0, yum v3.2.29, and repoquery v0.0.11,
repoquery -l rpm
prints nothing.If you are having this issue, try adding the
--installed
flag:repoquery --installed -l rpm
.DNF
Update:To use
dnf
instead ofyum-utils
, use the following command: