There is a package called yum-utils
that builds on YUM and contains a tool called repoquery
that can do this.
$ repoquery --help | grep -E "list\ files"
-l, --list list files in this package/group
Combined into one example:
$ repoquery -l time
/usr/bin/time
/usr/share/doc/time-1.7
/usr/share/doc/time-1.7/COPYING
/usr/share/doc/time-1.7/NEWS
/usr/share/doc/time-1.7/README
/usr/share/info/time.info.gz
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 of yum-utils
, use the following command:
$ dnf repoquery -l time
/usr/bin/time
/usr/share/doc/time-1.7
/usr/share/doc/time-1.7/COPYING
/usr/share/doc/time-1.7/NEWS
/usr/share/doc/time-1.7/README
/usr/share/info/time.info.gz
yum list packagename
That will show from which repository the package is in the third column of the output.
For already installed packages, that won't work, as the third column shows just "installed". In that case you can do e.g. "rpm -qi packagename", typically the Vendor, Packager and Build Host tags will give an indication to which repository the package belongs. Also it's quite common for some repo symbol being appended to the package version number.
Best Answer
It is generally not possible to install two versions of the same package. This usually results in unresolvable file conflicts, although there are rare cases in which you can have multiple versions of a package installed without conflict (e.g., the
kernel
package).It is possible to create a "fake" package that fulfills the missing dependency, although doing so indicates that something on your system is fundamentally broken (typically, someone has installed something that wasn't really intended for use on the particular distribution you're using). You would need to create a spec file with a
Provides:
line matching your dependency, along the lines of:Once upon a time I wrote a tool called fakeprovide that helps out with this sort of thing...if nothing else it might give you a template spec file to work with.
You could also grab the source RPM for
collectd
and rebuild it to be compatible with the version ofMySQL
installed on your system.