Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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.
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...
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...
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.