Yum is not working: Traceback (most recent call last):

Hi All,

I am getting this error while running yum command: i tried to rebuild the DB & “yum clean all”, nothing works.
Our server is CentOS release 5.9. Please help in this issue.

yum

Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 309, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 157, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 187, in getOptionsConfig
self.conf
File “/usr/lib/python2.4/site-packages/yum/init.py”, line 665, in
conf = property(fget=lambda self: self._getConfig(),
File “/usr/lib/python2.4/site-packages/yum/init.py”, line 240, in _getConfig
self._conf = config.readMainConfig(startupconf)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 805, in readMainConfig
yumvars[‘releasever’] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 884, in _getsysver
hdr = idx.next()
StopIteration

Hi

once look at the below link it may help you

https://www.centos.org/forums/viewtopic.php?t=13410

Hi raghu,

i checked this link, but still getting the same issue.

You must try the following commands in terminal for above issue

# wget ftp://rpmfind.net/linux/centos/5.11/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm

# rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm --force

# rm -rf /etc/yum.repos.d/*

# yum clean all

# yum upgrade

after that try to install an app via Yum

# yum install samba

Thats all…

Hi Gopal,

When i give “rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm --force”, i am getting this error:

warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, ke y ID e8562897
error: Failed dependencies:
/usr/bin/python is needed by yum-3.2.22-40.el5.centos.noarch
python >= 2.4 is needed by yum-3.2.22-40.el5.centos.noarch
python(abi) = 2.4 is needed by yum-3.2.22-40.el5.centos.noarch
python-elementtree is needed by yum-3.2.22-40.el5.centos.noarch
python-iniparse is needed by yum-3.2.22-40.el5.centos.noarch
python-sqlite is needed by yum-3.2.22-40.el5.centos.noarch
rpm >= 0:4.4.2 is needed by yum-3.2.22-40.el5.centos.noarch
rpm-python is needed by yum-3.2.22-40.el5.centos.noarch
urlgrabber >= 3.1.0 is needed by yum-3.2.22-40.el5.centos.noarch
yum-fastestmirror is needed by yum-3.2.22-40.el5.centos.noarch
yum-metadata-parser >= 1.1.0 is needed by yum-3.2.22-40.el5.centos.noarc h

It is due to outdated Yum package dependency…

Use given command one by one

# rm -rf /etc/yum.repos.d/*

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/gmp-4.1.4-10.el5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/readline-5.1-3.el5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/python-2.4.3-56.el5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/libxml2-2.6.26-2.1.15.el5_8.6.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/libxml2-python-2.6.26-2.1.15.el5_8.6.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/expat-1.95.8-11.el5_8.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/sqlite-3.3.6-6.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/elfutils-libelf-0.137-3.el5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/elfutils-0.137-3.el5.x86_64.rpm --force --nodeps

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/rpm-4.4.2.3-31.el5.x86_64.rpm --force --nodeps

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/rpm-python-4.4.2.3-31.el5.x86_64.rpm --force --nodeps

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/m2crypto-0.16-9.el5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/python-urlgrabber-3.1.0-6.el5.noarch.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm --force

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm --force --nodeps

# rpm -ivh http://mirror.centos.org/centos-5/5.9/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm --force

# yum clean all

# yum update

That’s all…

2 Likes

i am not able to install individual rpm’s as you suggested, when i try, getting this:

warning: /var/tmp/rpm-xfer.5hUlPN: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
/sbin/ldconfig is needed by gmp-4.1.4-10.el5.i386
libc.so.6 is needed by gmp-4.1.4-10.el5.i386
libc.so.6(GLIBC_2.0) is needed by gmp-4.1.4-10.el5.i386
libc.so.6(GLIBC_2.1.3) is needed by gmp-4.1.4-10.el5.i386
libc.so.6(GLIBC_2.2) is needed by gmp-4.1.4-10.el5.i386
libc.so.6(GLIBC_2.3) is needed by gmp-4.1.4-10.el5.i386
libc.so.6(GLIBC_2.3.4) is needed by gmp-4.1.4-10.el5.i386
libc.so.6(GLIBC_2.4) is needed by gmp-4.1.4-10.el5.i386
libgcc_s.so.1 is needed by gmp-4.1.4-10.el5.i386
libgcc_s.so.1(GCC_3.0) is needed by gmp-4.1.4-10.el5.i386
libm.so.6 is needed by gmp-4.1.4-10.el5.i386
libstdc++.so.6 is needed by gmp-4.1.4-10.el5.i386
libstdc++.so.6(CXXABI_1.3) is needed by gmp-4.1.4-10.el5.i386
libstdc++.so.6(GLIBCXX_3.4) is needed by gmp-4.1.4-10.el5.i386
rtld(GNU_HASH) is needed by gmp-4.1.4-10.el5.i386

You are using too outdated CentOS 5.9 packages,

If you created the offline repository…

Simply run the following commands on terminal

Find the Yum Package version Number

# rpm -qi yum

After finding the version number of yum package

You can find the package here

http://rpmfind.net/

Remove the Yum package

# rpm -e yum

Install the yum package

# rpm -ivh LINK of PACKAGE

Note your package is same number noted above old version other wise it caused dependency hell…

Hi Gopal,
Thank you for your quick help, it worked for me.

Thanks very much for the great answer , you saved me alot of time.

Please find the packages for Centos 5.11

rpm -ivh ftp://195.220.108.108/linux/centos/5.11/os/x86_64/CentOS/gmp-4.1.4-10.el5.x86_64.rpm --force
rpm -ivh ftp://195.220.108.108/linux/centos/5.11/os/x86_64/CentOS/readline-5.1-3.el5.x86_64.rpm --force
rpm -ivh ftp://195.220.108.108/linux/centos/5.11/os/x86_64/CentOS/python-2.4.3-56.el5.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/updates/x86_64/RPMS/libxml2-2.6.26-2.1.25.el5_11.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/libxml2-python-2.6.26-2.1.21.el5_9.3.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/expat-1.95.8-11.el5_8.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/sqlite-3.3.6-7.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/elfutils-libelf-0.137-3.el5.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/elfutils-0.137-3.el5.x86_64.rpm --force --nodeps
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/rpm-4.4.2.3-34.el5.x86_64.rpm --force --nodeps
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/rpm-python-4.4.2.3-34.el5.x86_64.rpm --force --nodeps
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/m2crypto-0.16-9.el5.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/python-urlgrabber-3.1.0-6.el5.noarch.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm --force
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm --force --nodeps
rpm -ivh ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm --force
yum clean all
yum update