Determining the path that a yum package installed to
yum uses RPM, so the following command will list the contents of the installed package:
$ rpm -ql package-name
to what location on disk does yum installs python packages by default?
I got it by little bit of digging ,
I searched like this :
rpm -ql python2-rpdb-0.1.5-2el7.1.noarch
its installed in the /usr/lib/python2.7/site-packages folder
or in /usr/lib64/python2.7/
Yum Installed Package But I Cant Find It
You did not install soundtouch
package, yum is telling you that this package is obsoleted by libsoundtouch
. You can check which files belong to that package:
rpm -ql libsoundtouch
How to list the contents of a package using YUM?
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
Best way to check for installed yum package/rpm version in Ansible and use it
The way you do it is perfectly fine. The check which is causing the warning is very simply and just checks the first word against a pre-defined list. It ignores further options and often results in warnings which can not be solved with the corresponding module, like in the yum
case.
To get rid of the warning you can simply do a which
:
shell: `which yum` list installed custom-rpm | grep custom-rpm | awk '{print $2}' | cut -d'-' -f1
which
looks up the the complete path of yum
, which then is executed. It's the exact same thing, but from viewpoint of Ansible it calls which
, not yum
which avoids the warning.
If you want to deactivate this kind of warnings globally you can set command_warnings = False
in your ansible.cfg
. (See docs)
According to the docs you can also add warn=no
at the end of your command but this really looks strange to me as it appears to be part of the command.
Can yum tell me which of my repositories provide a particular package?
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.
Determine if package installed with Yum Python API?
import yum
yb = yum.YumBase()
if yb.rpmdb.searchNevra(name='make'):
print "installed"
else:
print "not installed"
How do I find out w/YUM or RPM what files it installed?
Use the --filesbypkg argument for rpm.
rpm -qi --filesbypkg nx
How to list installed packages from a given repo using yum
On newer versions of yum, this information is stored in the "yumdb" when the package is installed. This is the only 100% accurate way to get the information, and you can use:
yumdb search from_repo repoid
(or repoquery and grep -- don't grep yum output).
However the command "find-repos-of-install" was part of yum-utils for a while which did the best guess without that information:
http://james.fedorapeople.org/yum/commands/find-repos-of-install.py
As floyd said, a lot of repos. include a unique "dist" tag in their release, and you can look for that ... however from what you said, I guess that isn't the case for you?
Related Topics
Linux Newbie: Linux VS Posix Manual
If I Have a Process, and I Clone It, Is the Pid the Same
How to Get Details of All Modules/Drivers That Were Initialized/Probed During the Linux Kernel Boot
Merge Files with Bash by Primary Key
Cannot Use Wildcard in Kernel Module Makefile
Compile/Run Assembler in Linux
Number of Processors/Cores in Command Line
Using Iconv to Convert from Utf-16Le to Utf-8
Expand a Possible Relative Path in Bash
How to Make One Linux Kernel Module Depend on Another External Module with Depmod
Different Results Between Ps Aux and 'Ps Aux' Inside a Script
How to Detect Usb Drive Insertion in Linux
Gdb: Redirect Target Stdout Temporarly
Extending a Script to Loop Over Multiple Files and Generate Output Names
How to Get Out of 'Screen' Without Typing 'Exit'