Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92
Rep:
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
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 ?
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92
Original Poster
Rep:
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.
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.