CentOS cPanel ISO - yum update errors

envisage

Member
Oct 1, 2014
5
0
1
cPanel Access Level
Root Administrator
Hi All,

I have deployed the cPanel-CentOS-6.4-x86_64.iso on a brand new VMware virtual machine located in a data centre, all is running well except for the fact that any yum command (including yum update) is throwing up the error below. Have tried to search and have done all sorts of reading for this but can't seem to get to the bottom of it.

Output is below, can anybody help with this please? From my reading it seems to be some sort of python error, but any solution I can find involves using yum to reinstall python modules which it won't let me do!

Code:
[email protected] [~]# yum update
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 285, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 105, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 228, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 891, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 299, in _getConfig
    startupconf = config.readStartupConfig(fn, root)
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 885, in readStartupConfig
    startupconf.releasever = _getsysver(startupconf.installroot, startupconf.distroverpkg)
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 1036, in _getsysver
    hdr = idx.next()
StopIteration
[email protected] [~]#
Anyone have any ideas?
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

It's possible your server does not have enough memory to support the "yum update" command. Try editing the /etc/yum/pluginconf.d/fastestmirror.conf file and change "enable=1" to "enable=0" to see if that makes a difference. Note the memory requirements for cPanel are listed here:

Hardware Requirements

Thank you.
 

envisage

Member
Oct 1, 2014
5
0
1
cPanel Access Level
Root Administrator
Hi cPanelMichael, thanks for your quick reply.

I came across this solution on another thread but unfortunately did not work for me. This server has 12GB memory and plenty of HDD space. Could there be anything else? Below is a snippet of my "top" output for memory:

Mem: 12197804k total, 909404k used, 11288400k free, 49248k buffers
Swap: 6168572k total, 0k used, 6168572k free, 425984k cached

Thanks again
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
You could try reinstalling Python, but since this is a fresh installation, you may simply want to try reinstalling CentOS 6 on it's own and then installing cPanel separately.

Thank you.
 

envisage

Member
Oct 1, 2014
5
0
1
cPanel Access Level
Root Administrator
Thanks cPanelMichael, what would be the commands to reinstall Python without using yum?

I have been reading this thread, and believe this will help but am unsure how to translate the solution into CentOS 6 and x86_64
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
You could try "yum reinstall python", but reinstalling the OS is likely the best way to go. The error indicates the initial installation may not have completed successfully.

Thank you.
 

envisage

Member
Oct 1, 2014
5
0
1
cPanel Access Level
Root Administrator
Just a followup for anyone else with the same issue, with the help of cPanel support we ended up finding the problem.

It turned out to be a corrupt RPM database, as all the needed rpm packages were actually already installed but not recognised.

The following command rebuilt the RPM database and yum started functioning properly afterwards:

for i in `find /var/lib/rpm/ -type f -name __db.00*`; do mv -v $i $i.old; done db_verify /var/lib/rpm/Packages rpm -v --rebuilddb yum clean all
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I am happy to see the issue is now resolved. Thank you for updating us with the outcome.