[Yum] yum repolist vs. grep -i enabled *.repo

Larry Vaden vaden at texoma.net
Thu Jan 27 02:42:58 UTC 2011


Hello,

After attempting a migration from CentOS 5.5 to Scientific Linux 5.5,
the result is a system in an inconsistent state.

The basic stanza used for the migration was from
SCIENTIFIC-LINUX-USERS at LISTSERV.FNAL.GOV and is below the yum/grep
output.

Trying to learn more about yum and its use, I ran the commands below the sig.

1) What am I missing about the possible/perceived discrepancies
between the outputs of yum repolist and grep?

2) For a given installed package, is it possible to get yum to
identify which repository was used for the installation?

THANKS for your thoughts.

kind regards/ldv

Larry Vaden, CoFounder
Internet Texoma, Inc.
Serving Rural Texomaland Since 1995
We Care About Your Connection!

[root at shell yum.repos.d]# yum repolist all
Loaded plugins: kernel-module
repo id                                    repo name
                                             status
addons                                     CentOS-5.5 - Addons
                                             enabled:     0
adobe                                      Adobe Systems Incorporated
                                             disabled
atrpms                                     ATrpms rpms
                                             disabled
base                                       CentOS-5.5 - Base
                                             enabled: 2,599
c5-media                                   CentOS-5.5 - Media
                                             disabled
centosplus                                 CentOS-5.5 - Plus
                                             disabled
contrib                                    CentOS-5.5 - Contrib
                                             disabled
dag                                        DAG rpms
                                             disabled
extras                                     CentOS-5.5 - Extras
                                             enabled:   337
sl-base                                    SL 5 base
                                             enabled: 2,734
sl-contrib                                 Scientific Linux 5 contrib
area                                          disabled
sl-debuginfo                               Scientific Linux 5
debuginfo rpm's                                       disabled
sl-fastbugs                                SL 5 fastbugs area
                                             disabled
sl-security                                SL 5 security updates
                                             enabled:   811
sl-source                                  Scientific Linux 5 source
rpm's (src.rpm)                                disabled
sl-testing                                 Scientific Linux 5 testing
area                                          disabled
updates                                    CentOS-5.5 - Updates
                                             enabled:   872
repolist: 7,353
[root at shell yum.repos.d]# yum repolist enabled
Loaded plugins: kernel-module
repo id                                              repo name
                                             status
addons                                               CentOS-5.5 -
Addons                                            enabled:     0
base                                                 CentOS-5.5 - Base
                                             enabled: 2,599
extras                                               CentOS-5.5 -
Extras                                            enabled:   337
sl-base                                              SL 5 base
                                             enabled: 2,734
sl-security                                          SL 5 security
updates                                          enabled:   811
updates                                              CentOS-5.5 -
Updates                                           enabled:   872
repolist: 7,353
[root at shell yum.repos.d]# yum repolist disabled
Loaded plugins: kernel-module
repo id                                       repo name
                                                   status
adobe                                         Adobe Systems
Incorporated                                                  disabled
atrpms                                        ATrpms rpms
                                                   disabled
c5-media                                      CentOS-5.5 - Media
                                                   disabled
centosplus                                    CentOS-5.5 - Plus
                                                   disabled
contrib                                       CentOS-5.5 - Contrib
                                                   disabled
dag                                           DAG rpms
                                                   disabled
sl-contrib                                    Scientific Linux 5
contrib area                                             disabled
sl-debuginfo                                  Scientific Linux 5
debuginfo rpm's                                          disabled
sl-fastbugs                                   SL 5 fastbugs area
                                                   disabled
sl-source                                     Scientific Linux 5
source rpm's (src.rpm)                                   disabled
sl-testing                                    Scientific Linux 5
testing area                                             disabled
repolist: 7,353
[root at shell yum.repos.d]# grep -i enabled= *.repo
adobe.repo:enabled=0
atrpms.repo:enabled=0
CentOS-Base.repo:enabled=0
CentOS-Base.repo:enabled=0
CentOS-Media.repo:enabled=0
dag.repo:enabled=0
sl-contrib.repo:enabled=0
sl-debuginfo.repo:enabled=0
sl-fastbugs.repo:enabled=0
sl.repo:enabled=1
sl-security.repo:enabled=1
sl-srpms.repo:enabled=0
sl-testing.repo:enabled=0
[root at shell yum.repos.d]#

=== attribution: SCIENTIFIC-LINUX-USERS at LISTSERV.FNAL.GOV

"To be REALLY sure of a full conversion one might try:

yum reinstall $(rpm -qa --qf "%{name}.%{arch} %{vendor} \n" | \
 grep -i centos | cut -d ' ' -f 1 | sort | uniq | grep -v kernel)

Need special handling for kernel and kernel-devel as you will get
messages about multiple versions being allowed, and cutting off the limb
on which you are standing is not recommended."


More information about the Yum mailing list