What is the meaning of status column in the yum repolist output on Red Hat Enterprise Linux 6?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

  • What is the meaning of status column in the yum repolist output on Red Hat Enterprise Linux 6?

      # yum repolist 
      Loaded plugins: priorities, rhnplugin
      repo id                                                   repo name                                                       status
      rhel-x86_64-server-6                                      Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)         5,098+2  <-- 
      rhel-x86_64-server-optional-6                             RHEL Server Optional (v. 6 64-bit x86_64)                        3,525
      rhn-tools-rhel-x86_64-server-6                            RHN Tools for RHEL (v. 6 for 64-bit x86_64)                      42
      repolist: 8,665
    

Resolution

  • Looking in the source code we can observe:

    yumcommands.py
    ---------------------------------------
    class RepoListCommand(YumCommand):
        def getNames(self):
            return ('repolist',)
    
      {... SNIP ...}
                    # We don't show status for list disabled
                     if arg != 'disabled' or verbose:
                         if verbose or base.conf.exclude or repo.exclude:
                             num        = len(repo.sack.simplePkgList())
                         else:
                             num        = len(repo.sack)
                         ui_num     = _num2ui_num(num)
                         excludes   = repo.sack._excludes
                         excludes   = len([pid for r,pid in excludes if r == repo])
                         if excludes:
                             ui_excludes_num = _num2ui_num(excludes)    
                             if not verbose:
                                 ui_num += "+%s" % ui_excludes_num <--- shows the number of excluded packages
                         tot_num   += num
    
  • Going further and looking at yum's man page:

    ".... 
      In  non-verbose  mode the first column will start with a '*' if the repo. has metalink data and the latest metadata is not local. For non-verbose mode
    the last column will also display the number of packages in the repo. and (if there are any user specified excludes) the number of packages excluded.
      .... "
    
  • The status column shows the number of packages available in repository. In the below example (5,098+2) means that there are 5100 packages in the repository out of which Number of packages can be install(5098) + packages excluded(2):

          # yum repolist 
          Loaded plugins: priorities, rhnplugin
          repo id                                 repo name                                                       status
          rhel-x86_64-server-6                    Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)         5,098+2 
    
  • To check which packages have been excluded from installation please check /etc/yum.conf file.

Root Cause

  • yum repolist output shows an expression with 'packages+number'

      # yum repolist 
      Loaded plugins: priorities, rhnplugin
      repo id                                                   repo name                                                       status
      rhel-x86_64-server-6                                      Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)         5,098+2  <-- 
    

Diagnostic Steps

  • To reproduce the situation, look the example below at a RHEL6 box:

       # cat /etc/redhat-release 
       Red Hat Enterprise Linux Server release 6.1 (Santiago)
    
      ** No packages were excluded
       # grep -i exclude /etc/yum.conf /etc/yum.repos.d/*
    
      # yum repolist 
       Loaded plugins: priorities, rhnplugin
       repo id                                                              repo name                                                         status
       rhel-x86_64-server-6                                                 Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)          5,100
       rhel-x86_64-server-optional-6                                        RHEL Server Optional (v. 6 64-bit x86_64)                         3,525
       rhn-tools-rhel-x86_64-server-6                                       RHN Tools for RHEL (v. 6 for 64-bit x86_64)                       42
       repolist: 8,667
    
      ** Adding 2 packages into the exclude list
    
      # grep -i exclude /etc/yum.conf /etc/yum.repos.d/*
       /etc/yum.conf:exclude=x3270 x3270-x11
    
      # yum repolist 
       Loaded plugins: priorities, rhnplugin
       repo id                                                      repo  name                                                        status
       rhel-x86_64-server-6                                         Red Hat  Enterprise Linux Server (v. 6 for 64-bit x86_64)         5,098+2  <--  2 pkgs excluded
       rhel-x86_64-server-optional-6                                RHEL  Server Optional (v. 6 64-bit x86_64)                        3,525
       rhn-tools-rhel-x86_64-server-6                               RHN Tools  for RHEL (v. 6 for 64-bit x86_64)                      42
       repolist: 8,665
    
  • Component
  • yum

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments