LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 10-08-2009, 06:55 PM   #1
stefanlasiewski
Member
 
Registered: Aug 2003
Location: Berkeley, California, USA
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92

Rep: Reputation: 16
Yum: What "Package Group" can provide a package?


Yum supports the idea of "Package groups". Here's a listing of available groups on my RHEL5.4 system, after a vanilla installation:

Code:
[root@host1 ~]# yum grouplist
Loaded plugins: rhnplugin, security
Setting up Group Process
Installed Groups:
   Editors
   Legacy Network Server
   Mail Server
   Network Servers
   System Tools
Available Groups:
   Administration Tools
   Authoring and Publishing
   DNS Name Server
   ...
   ...
Is there a way to tell which Package Groups will provide a particular individual package?

For example, "emacs" is provided by the "Editor" package group, the "Development Environment" package group, and possibly others. I'm looking for a theoretical command like "yum groupinfo-whatprovides emacs"?

Here's what I am doing right now, to query all of the package groups for the 'httpd' package. This is a little clunky, and I was looking for a simpler method.

Code:
[root@host1 ~]# yum grouplist >/tmp/yum.grouplist
[root@host1 ~]# cat /tmp/yum.grouplist |while read GROUP; do echo GROUP=$GROUP; yum groupinfo "$GROUP" |grep -i httpd; done
GROUP=Editors
GROUP=Legacy Network Server
...
...
GROUP=Server Configuration Tools
   system-config-httpd
GROUP=Sound and Video
GROUP=Text-based Internet
GROUP=Web Server
   httpd
   httpd-manual
   httpd-suexec
GROUP=Windows File Server
GROUP=X Software Development
GROUP=X Window System
Thank you,

-= Stefan
 
Old 10-08-2009, 09:20 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Well, I think you can eliminate the unwanted groups
Code:
yum grouplist >/tmp/yum.grouplist
for GROUP in `cat /tmp/yum.grouplist`
do 
    name=`yum groupinfo "$GROUP" |grep -i httpd`
    if [[ $? -eq  0 ]] # $? is status of last cmd in pipe ie matched
    then
        echo $GROUP = $name  
    fi
done
It's theoretically possible for the same pkg to turn up in many groups; don't know how often it happens.
Don't know if this page may inspire a different approach http://kbase.redhat.com/faq/docs/DOC-2531 ?
 
1 members found this post helpful.
Old 10-09-2009, 05:43 PM   #3
stefanlasiewski
Member
 
Registered: Aug 2003
Location: Berkeley, California, USA
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92

Original Poster
Rep: Reputation: 16
Thanks Chris.

It looks like RHEL does not support this feature. It's probably not a big deal, since it looks like RedHat has cleaned up the Package Groups in RHEL5. With RHEL4, there is more duplication.

Thanks again,

-= Stefan
 
Old 11-14-2010, 07:49 PM   #4
amacks
LQ Newbie
 
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0
Updated for rhel6

rhel 6 has some weird group names, there are spaces in the generic names. I added some sed magic to handle that, or at least most of it. This script will workfor all but:
English (UK) Support
Myanmar (Burmese) Support
Some smarter awkery would solve that, but I don't care enough. Save the following as a script and run it as root with one arg, the package you want to search for:
Code:
#!/bin/bash
yum grouplist -v | grep "^ " | cut -f 2 -d \( | sed -e "s/)//" > /tmp/yum.grouplist

for GROUP in `cat /tmp/yum.grouplist`
do 
    name=`yum groupinfo "$GROUP" |grep -i $1`
    if [[ $? -eq  0 ]] # $? is status of last cmd in pipe ie matched
    then
        echo $GROUP = $name  
    fi
done
rm /tmp/yum.grouplist
A
 
Old 03-07-2012, 01:49 PM   #5
kjerick
LQ Newbie
 
Registered: Mar 2012
Posts: 1

Rep: Reputation: Disabled
amacks, I found your post very helpful. I modified your script somewhat because there were a couple things that didn't work quite right yet. One I saw problem with RHEL 5.5 and another with RHEL 6.1.

For RHEL 5.5, the 'yum grouplist -v' portion of the command produces the following for one of the groups:

KDE (K Desktop Environment) (kde-desktop)

So the rest of the processing turns this into "K Desktop Environment" instead of "kde-desktop". I used a little awk to fix that one.

For RHEL 6.1 I didn't like that all the languages are listed and time is spent looking through them. 99.9%+ of the time I will not be looking for something in a language group, so I eliminated them with a little more grep to eliminate them, which all seemed to have [text] associated with them.

The net change to your code looks like this:

Code:
#!/bin/bash

yum grouplist -v | grep "^ " | grep -v "]$" | awk '{print $NF}' | sed -e "s/(//" | sed -e "s/)//" > /tmp/yum.grouplist

for GROUP in `cat /tmp/yum.grouplist`
do 
    name=`yum groupinfo "$GROUP"  2>&1 | grep -i $1`
    if [[ $? -eq  0 ]] # $? is status of last cmd in pipe ie matched
    then
        echo $GROUP : $name
    fi
done
rm /tmp/yum.grouplist
Hope someone else finds this useful,
Kevin
 
Old 03-11-2012, 08:38 PM   #6
Ernst0
LQ Newbie
 
Registered: Mar 2012
Location: California
Distribution: RHEL6
Posts: 26

Rep: Reputation: Disabled
Hey,

I'm befuddled here.. I paid for RHEL6 so I am hoping to get things like Ghex and Gcalctools 2.6 going and I see that yum bails (fails) with broken dependancies.

Is this Group thing a way to install all the needed packages for say Gnome?

Or other stuff?

I am looking at manually installing like 40 packages just to get a couple of dependancies resolved for Ghex and Gcalctool 2.6

Who know how many other dependancies will pop up.

Yes I am a previous Fedora user and pampered with Yum fetching and installing everything without me bothering.

I found the "Groupinstall" function for YUM and install "Compatability Libraries" didn't solve the configure: error: glib-compile-schemas not found.

I'm still looking..

This is frustrating.

Last edited by Ernst0; 03-11-2012 at 09:08 PM.
 
Old 06-12-2012, 06:34 PM   #7
Larry Baker
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
On CentOS 6.2 (RHEL 6.2) it's simple:

# yum groupinfo \*
 
Old 03-21-2013, 02:31 PM   #8
qux
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
For search engines: now the yum-list-data plugin can be used for the subject issue:

Code:
$ yum -C list-groups yum
...
==================== Installed Packages ====================
Core                      1 ( 50%)
Critical Path (Base)      1 ( 50%)
 
  


Reply

Tags
rhel5, rpm, yum


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't locate object method "splitpath" via package "PACK001" at /usr/lib/perl5/5.8.8/ sajigeorge Linux - Software 1 01-11-2009 07:33 AM
Which Flash Package? "Flashplugin-nonfree" or "flashplayer-mozilla" Zaskar Debian 3 04-02-2008 03:15 AM
perl install error: Can't locate object method "new" via package "Module::Build::Vers powah Linux - Software 0 10-24-2006 02:57 PM
How to list/remove the "package group" in RedHat linux ES 3.0? ajegu Linux - Software 1 06-25-2004 01:12 PM
Can't locate object method "splitpath" via package "File::Spec" RobJohnston Linux - General 2 06-28-2003 10:59 AM


All times are GMT -5. The time now is 05:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration