LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-15-2012, 05:58 PM   #1
Arty Ziff
Member
 
Registered: May 2008
Location: Tacoma, WA
Distribution: CentOS and RHEL
Posts: 124

Rep: Reputation: 15
Errors When Updating With YUM


Server Distro: CentOS v4

I am trying to update some packages with YUM and this is what I am being told:
Code:
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 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 145, in main
    (result, resultmsgs) = base.buildTransaction() 
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 647, in buildTransaction
    (rescode, restring) = self.resolveDeps()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 704, in resolveDeps
    for po, dep in self._checkFileRequires():
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 939, in _checkFileRequires
    if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename):
  File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 414, in getNewProvides
    for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 300, in getProvides
    return self._computeAggregateDictResult("getProvides", name, flags, version)
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 470, in _computeAggregateDictResult
    sackResult = apply(method, args)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 861, in getProvides
    return self._search("provides", name, flags, version)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
    return func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 837, in _search
    for pkg in self.searchFiles(name, strict=True):
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
    return func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 586, in searchFiles
    self._sql_pkgKey2po(rep, cur, pkgs)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 470, in _sql_pkgKey2po
    pkg = self._packageByKey(repo, ob['pkgKey'])
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 413, in _packageByKey
    po = self.pc(repo, cur.fetchone())
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 68, in __init__
    self._read_db_obj(db_obj)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 94, in _read_db_obj
    setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object
So, I'm not sure what's going on.

Actually, the only packages I *really* want to update are my PHP rpms:
Code:
rpm -qa |grep php
php-common-5.2.11-jason.1
php-pgsql-5.2.11-jason.1
php-imap-5.2.11-jason.1
php-cli-5.2.11-jason.1
php-xml-5.2.11-jason.1
php-devel-5.2.11-jason.1
php-pdo-5.2.11-jason.1
php-5.2.11-jason.1
php-mcrypt-5.2.11-jason.1
php-mbstring-5.2.11-jason.1
php-pear-1.7.2-2.jason.1
php-mysql-5.2.11-jason.1
php-xcache-1.2.2-jason.4
php-ldap-5.2.11-jason.1
php-gd-5.2.11-jason.1
I can't remember why I used a non-CentOS repository. I suspect it's because when I wanted to upgrade to PHP 5.2.11, CentOS didn't have it.

So... two questions:

1. What's the error I'm getting?

2. If I want to side-step there error for the time being and just upgrade PHP, how might I go about that?

I'd like to get php v. 5.3.2 or better if possible.

Thanks,

- Arty
 
Old 03-15-2012, 06:11 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
That is not a traditional yum error. The error is being reported when the binary application "yum" fails to run as it should. So the issue here is really with yum and in most cases this sort of error can indicate a file system corruption or hopefully, a corrupted binary file.

Taking a look at the log files may help point you in the right direction. The kernel messages file at /var/log/messages is likely to have something about the problem and the yum logs also in /var/log/ may contain some info but probably not.


Your best bet here would be to attempt to re-install the yum package manually and see if that helps. This will be dependent on the OS, arch, etc.. that your system is using.

I would first try doing a simply rpm database rebuild and verify to see if that helps.

rpm --rebuilddb
rpm -Va

You may also want to consider backing up your data and running a filesystem check. BACKUP YOUR DATA!

PHP can always be built and compiled from source and most would say that is the best way to go as you can lock down PHP and compile it with only what you need to make it run for your system. However, if this is just a simple CentOS box running some web-apps that are not critical the easy way to go is to add the atomic repository and do a yum update php. Atomic repo is a good one for CentOS and is designed to work with web-apps running under the Plesk control panel. If you are using cPanel you can use EasyApache(see docs.cpanel.net) to recompile php/apache.

An important note here is that upgraded php from the 5.2 family to 5.3 will usually upgrade MySQL as a dependency. In order to complete the upgrade you MUST run the mysqlupgrade command. Check out dev.mysql.com/doc/refman/5.5/en/mysql-upgrade.html.

Start off by reviewing the log files and if you notice anything out of the ordinary post it here so you can get some input on what the actual root cause of your issue may be.
 
Old 03-15-2012, 06:15 PM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
You should also take a look at /etc/yum.repos.d/ and see what repos you have running as the packages you have installed on your system: php-common-5.2.11-jason.1 are definitely not a stable version. Who is Jason? I didnt know he was a revision number..

Worst case scenario you will just need to back up your data, dump your MySQL dbs and re-image. If you have secondary drives or partitions available I would set up a mount there rsync your data over and re-image it just to get those bad packages completely removed.
 
Old 03-15-2012, 10:14 PM   #4
Arty Ziff
Member
 
Registered: May 2008
Location: Tacoma, WA
Distribution: CentOS and RHEL
Posts: 124

Original Poster
Rep: Reputation: 15
After doing some searching on the Intertubes (as I should have done in the first place), I came up with this:

yum clean metadata

...and things progressed as I wanted.

Thanks for the YUM tips, it took me down some roads I might not have explored.
 
Old 03-15-2012, 11:36 PM   #5
Arty Ziff
Member
 
Registered: May 2008
Location: Tacoma, WA
Distribution: CentOS and RHEL
Posts: 124

Original Poster
Rep: Reputation: 15
Actually the update went very well. Except for php, which is what I need to update. Probably because of the odd versions I'm running.

If my bad memory serves me, the reason I installed these version is because when I *needed* to upgrade, there were not yet any "official" rpm packages for this version, which is what I am now stuck with...

http://www.jasonlitka.com/yum-repository/

Code:
# rpm -qa |grep php
php-mbstring-5.2.17-jason.2
php-pdo-5.2.17-jason.2
php-mcrypt-5.2.17-jason.2
php-common-5.2.17-jason.2
php-gd-5.2.17-jason.2
php-cli-5.2.17-jason.2
php-pear-1.9.4-1.jason.1
php-mysql-5.2.17-jason.2
php-pgsql-5.2.17-jason.2
php-ldap-5.2.17-jason.2
php-xml-5.2.17-jason.2
php-xcache-1.3.2-jason.1
php-5.2.17-jason.2
php-devel-5.2.17-jason.2
php-imap-5.2.17-jason.2
What would be the best approach to jettison these and install whatever is fresh in the CentOS repositories?

Yum tells me there are no packages to update, but that can't be true, can it?
Code:
# yum update php
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirrors.kernel.org
 * extras: mirrors.usc.edu
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirrors.cat.pdx.edu
Setting up Update Process
No Packages marked for Update
[root@localhost ~]# php -v
PHP 5.2.17 (cli) (built: Aug 31 2011 17:06:47) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with XCache v1.3.2, Copyright (c) 2005-2011, by mOo
So I'm a bit lost...

Last edited by Arty Ziff; 03-15-2012 at 11:55 PM.
 
Old 03-16-2012, 12:23 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
this is cent 4
the now END OF LIFE cent 4
there will be NO more updates
that was the last
Quote:
Probably because of the odd versions I'm running.
CentOS 4.9 is End Of Life
please install the current version of Cent , CentOS 6.2
Quote:
What would be the best approach to jettison these and install whatever is fresh in the CentOS repositories?
there is NO fresh/new rpm's for cent 4

your BEST bet is to upgrade to cent 6
but if you intend on continuing to use a UNSUPPORTED version

uninstall those non cent rpms
Code:
su -
rpm -qa | grep jason
and use rpm to remove them
or YUM seeing as it looks like you installed yum on cent4
then remove any repos that are NOT cent4
Code:
yum repolist all
will give a list of " all" that are installed whether or not they are on or off
then remove the needed repo files and rebuild the rpm database


but you should install CentOS6.2
 
Old 03-16-2012, 11:06 AM   #7
Arty Ziff
Member
 
Registered: May 2008
Location: Tacoma, WA
Distribution: CentOS and RHEL
Posts: 124

Original Poster
Rep: Reputation: 15
I'm on version 5.4, actually. not 4 (my mistake).

It's nice to be able to just install the latest OS version, well, "because", but that's not always possible.

And, - serious question - if this version has served me well for the most part and been very stable for my needs, what is the benifit to me to upgrading from 5 to 6? To be on CentOS's bleeding edge? Yesterday, when I ran update, was the very first time in almost two years that I had to reboot the machine. There is no mail server running on this box. It is behind a firewall appliance and its sole purpose is to serve web pages, none of which require HTTPS. It's not connected to any tasty networks, and indeed I have large swaths of IP ranges simply blocked because I don't do business in Russia, China, Nigeria, or any of the other Internet vacation spots of ill-repute.

I guess I'm asking if the purpose is to upgrade just to upgrade, or some other reason?

It is unlikely this machine will ever do more than it is doing right now, and php is the single thing I would like a newer version of...

I mean, sure, I'm not trying to be a flaky amateur server admin (amateur yes, but I try not to be flaky), if there is COMPELLING reason to upgrade, well, it has to be done...

Last edited by Arty Ziff; 03-16-2012 at 11:38 AM.
 
Old 03-16-2012, 02:15 PM   #8
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
If you want to do a quick PHP upgrade on CentOS 5. Add the atomic repo, google wget atomic repo, do yum update php mysql. MySQL will need to be upgraded due to PHP dependencies. So after the yum transaction completes run the mysql_upgrade command on your databases so the MySQL table gets upgraded correctly.
 
Old 03-18-2012, 08:29 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, RHEL/Centos is the stable/production version. The 'bleeding edge' is Fedora, which is used by RH to research/test/refine proposed new functionality.

If you want current versions of SW, upgrading to 5.x or 6.x would be the best way, otherwise you may be trying to force new SW onto an old OS, which is likely to cause issues.
Ultimately it's you choice; if it works for you, go for it.
It's just good to be aware of support/update limits etc.

The support lifetimes are listed here https://access.redhat.com/support/po...pdates/errata/ to help you decide.

You may not know that upgrading in-place across major versions eg 4.x->5.x or 5.x->6.x is not supported, so a clean install is recommended.
Again, it's your choice but I wouldn't do it, especially on a 'prod' system.
 
  


Reply

Tags
centos, errors, php, yum



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yum update transaction check errors & mirror errors tonycunn Linux - Software 2 11-29-2010 08:16 AM
[SOLVED] yum not updating arunvk Linux - Newbie 6 08-30-2010 02:19 PM
while yum updating the following errors are showing please help me to solve the probl cybionix Fedora 6 01-30-2009 03:30 AM
Yum Errors in parsing, whats wrong here (yum.conf pasted) thejokker Linux - Newbie 1 06-15-2004 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration