CentOS 5 Upgrade and Yum

22.11.2008 13:17

posted by: Benjamin Smith

Posted Under: , ,

At the office I recently upgraded a machine to CentOS 5.2 from CentOS 4.7 (filesystem stayed intact). Everything was cool until I ran into a bit of an issue when attempting to update and regen the yum cache. I got a python traceback that looked like this:

# yum update
base      : ################################################## 2458/2458
update                    100% |=========================|  951 B    00:00
primary.xml.gz            100% |=========================| 242 kB    00:00
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 105, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 289, in doCommands
    self._getTs()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 85, in _getTs
    self._getTsInfo()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 91, in _getTsInfo
    self._tsInfo.setDatabases(self.rpmdb, self.pkgSack)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 537, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 392, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 242, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 168, in populate
    dobj = repo_cache_function(xml, csum)
  File "/usr/lib64/python2.4/site-packages/sqlitecachec.py", line 42, in getPrimary
    self.repoid))
TypeError: Can not prepare packages insertion: table packages has no column named location_base

Eeek! Got the same error when running yum makecache. Quick look at the traceback is somewhat obvious, the DB schema changed, but the DB didn’t get upgraded! Easy fix is to clear out your yum cache like so:

# cd /var/cache/yum
# rm -r *

And then you’ll want to regenerate your cache like so:

# yum makecache

Hope this helps anyone else who runs into this issue!

0 comments | 0 pingbacks

Yaaay blog spam!

17.01.2008 19:04

posted by: Benjamin Smith

Posted Under: , , , , , ,

So, I've noticed lately that one of my more popular blog entries has taken on some spam. I'll work on cleaning that up and implementing countermeasures.

In the mean time... I'm alive! Been working my tail off in preparation for Valentines day at work. It's the busiest time of the year for us. Just got back from VA where another sysadmin and I installed 50 new servers. It went well! Wrote some python to convert my inventory list from csv to our flat file format.

I've also been engineering a new syslogging system for our shop. It's a combination of a shell script that does archiving and checksum accounting, Splunk, and syslog-ng. Good times.

I've also had the (dis)pleasure of building RPM's lately....Not my favorite past-time. I really _really_ wish I could convince our team that the massive undertaking involved in converting from CentOS to debian would be worth it :). Not that I don't like CentOS, but I do love me some Debian.

That's all for now!

6 comments | 0 pingbacks
More Posts: