Posts Tagged ‘yum’

Python setuptools and get_python_version is not defined

Sunday, September 12th, 2010

If you run into the below error when using setuptools (setup.py), then it’s quite possible that you’re using an outdated version of Python’s setuptools. In particular, the python-setuptools package in the CentOS yum repository is too old.

Traceback (most recent call last):
File “setup.py”, line 19, in ?
setup(**metadata)
File “/usr/lib64/python2.4/distutils/core.py”, line 149, in setup
dist.run_commands()
File “/usr/lib64/python2.4/distutils/dist.py”, line 946, in run_commands
self.run_command(cmd)
File “/usr/lib64/python2.4/distutils/dist.py”, line 966, in run_command
cmd_obj.run()
File “/usr/lib/python2.4/site-packages/setuptools/command/bdist_rpm.py”, line 28, in run
_bdist_rpm.run(self)
File “/usr/lib64/python2.4/distutils/command/bdist_rpm.py”, line 377, in run
self.move_file(rpm, self.dist_dir)
File “/usr/lib/python2.4/site-packages/setuptools/command/bdist_rpm.py”, line 20, in move_file
getattr(self.distribution,’dist_files’,[]).append(
NameError: global name ‘get_python_version’ is not defined

Luckily, this is quite easy to fix; simply remove the RPM and download the latest version from http://pypi.python.org/pypi/setuptools then just run it with “sh” as if it was a normal shell script.

HyperVM and yum update Transaction Check Errors

Monday, August 16th, 2010

If you’re having file conflict problems when running “yum update” on servers with the lxlabsupdate repository for HyperVM (or Kloxo) installed then there’s a simple resolution:

cd /var/cache/yum/lxlabsupdate/packages/
rpm -Uvh *.rpm –replacefiles –replacepkgs

This should fix errors such as:

file /usr/share/man/man1/pcregrep.1.gz from install of pcre-8.02-1.el5_5.1.x86_64 conflicts with file from package pcre-6.6-2.el5_1.7.i386
file /usr/share/man/man1/pcretest.1.gz from install of pcre-8.02-1.el5_5.1.x86_64 conflicts with file from package pcre-6.6-2.el5_1.7.i386

Cancelled yum transactions

Saturday, May 22nd, 2010

If you’ve ever aborted a yum update for any reason, you’ve probably come across messages warning of transaction errors, such as the following example during an update from CentOS 5.4 to CentOS 5.5 that got cancelled part way through:

Transaction Check Error:
file /usr/include/libdevmapper.h from install of device-mapper-1.02.39-1.el5.i386 conflicts with file from package device-mapper-1.02.32-1.el5.x86_64
file /usr/share/man/man8/dmsetup.8.gz from install of device-mapper-1.02.39-1.el5.i386 conflicts with file from package device-mapper-1.02.32-1.el5.x86_64

Error Summary
————-

At the very start of the yum output, after “Resolving Dependencies” you should also see message saying

There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package..

This is nice and easy to resolve thankfully, you just need to use the suggested yum-complete-transaction utilit, which as the message suggests, can be found in the yum-utils package package.
This works just like the main yum program, except you don’t need to give it any arguments like install or update, you just run it and it will finish any incomplete transactions. hopefully this will fix any broken or cyclic dependancies where an update has been cancelled part way through.

I did find it somewhat ironic when I ran “yum install yum-utils” to gain access to the yum-complete-transaction command, I received the same message to install yum-complete-transaction via the yum-utils package, as that is exactly what I was trying to do!
Luckily, you can still install the yum-utils package from the normal system yum repositories whilst you have an outstanding transaction so you don’t have to mess around with downloading the RPM and installing it yourself.

yum install and weird architecture behaviour

Friday, April 23rd, 2010

I was just trying to accomplish what you would think was a relatively easy task – installing the PHP-GD package from the Atomic Rocket Turtle repository for 64bit CentOS 5 and ran into a slightly cryptic problem.

Running yum install php-gd simply produced a dependancy error

php-gd-5.2.13-1.el5.art.i386 from atomic has depsolving problems
–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.13-1.el5.art.i386 (atomic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.13-1.el5.art.i386 (atomic)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

A quick check that I’m using an up to date mirror along with a yum clean all to make sure nothing weird is happening leaves me back where I started, but a bit of digging later reveals that this is an interesting problem with yum on 64bit systems where it is trying to install the 32bit package and looking for 32bit dependancies. Forcing the install to be 64bit with yum install php-gd.x86_64 works first time :)

Weirdest Linux command ever

Thursday, March 25th, 2010

This morning I had to run possibly the most bizzare Linux command ever whilst stripping down a CentOS server:

yum remove troursers

That really brightened up my day and made me smile. :)