List all packages in yum group
yum groupinfo "Development tools"
Which yum group(s) contain a given package?
If you are only looking for a 'simpler mechanism' to be used by a human and don't need it in some kind of script or so, you might get by with this one:
yum groupinfo '*' | less +/sendmail-cf
Of course, replace sendmail-cf
with the package name you're interested in.
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
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?
How to install multiple groups in one shot with ansible yum module?
In your example, you are not passing "a list of packages". You are
passing a single string:
- name: Install libvirt
yum:
name: '"@Virtualization Hypervisor" "@Virtualization Client"'
A list would look something like this:
- name: Install libvirt
yum:
name:
- "@Virtualization Hypervisor"
- "@Virtualization Client"
Of if you prefer, the following is identical:
- name: Install libvirt
yum:
name: ["@Virtualization Hypervisor", "@Virtualization Client"]
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.
Related Topics
Linux: Move 1 Million Files into Prefix-Based Created Folders
Scale PDF to Add Border for Printing Full Size Pages
Thread Quantum: How to Compute It
Ubuntu/Fedora: How to Add Applications in The Menus
Docker Installation on Linux Mint 19.2 Doesn't Work
How to Test My Bash Script on Older Versions of Bash
How to Remove Warning: Link.Res Contains Output Sections; Did You Forget -T
Copy N Bytes of Data X to File
Tar Command Changing The Owner:Group While Extracting
Dos2Unix: Binary Symbol Found, Skipping Binary File
Can Linux Flock(Fd, Lock_Ex|Lock_Nb) Fail Spuriously
Bash Tries to Execute Commands in Heredoc
Nasm Assembly Linux Timer or Sleep
Problems Building Libcurl 7.21.2 on Ubuntu 11.10 (Hiphop)
Is There an Os Command I Can Run to Determine If Running Inside a Xen Based Virtual Machine