yum seems to depend on python2.4, but agrees with python2.5

Bug #238013 reported by madumlao
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
yum (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Hardy by Walter Franzini

Bug Description

Binary package hint: yum

I am trying to write out an Linux training course for system administrators. I am aiming to be distribution neutral. For this matter, I intend to tackle both yum and apt-get. I am running Ubuntu 8.04 desktop and am intending to demonstrate usage of both yum and apt-get. Demonstration units will be running 8.04 server. I will be demonstrating the use of both yum and rpm. However, the yum coming from the apt repositories fails.

===sample command
markd@embalsama:~$ sudo yum install fluxbox
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named cElementTree

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]

If you cannot solve this problem yourself, please send this
message to <email address hidden>.
===

The package in question is python-celementtree. It is installed on my unit
under python2.4.

===verifying existence of cElementTree
markd@embalsama:~$ ls /usr/lib/python2.4/site-packages/cElementTree*
/usr/lib/python2.4/site-packages/cElementTree.so

/usr/lib/python2.4/site-packages/cElementTree-1.0.5_20051216-py2.4.egg-info:
dependency_links.txt PKG-INFO SOURCES.txt top_level.txt
===
my celementtree version is also posted below.

What appears to happen is that yum tries to run under python2.5 and then fails to find its dependencies.

What should happen is one of the following:
1) that yum runs under python2.4 and finds it dependencies
2) that celementtree has a python2.5 version (possibly not possible/compatible)

Some possible solutions/workarounds to the problem are
1) python alternatives system in debian has to be rethinked/developed to allow individual packages to select versions of python to run. (Does python have native working of this?) (possibly debian python bug)
2) python itself needs to allow individual packages to select versions of python to run. (see above) (possibly python feature request)
3) yum debian package needs to be smart enough to depend on and use the python version it works on.
4) edit #!/usr/bin/python -> #!/usr/bin/python2.4 in /usr/bin/yum and yum-arch executables. Quick and dirty solution, but it works and is the workaround I used.

What should not happen is
1) user is told to change global python requirement to python2.5. This is a wrong solution. User may prefer python2.5 for most packages but need python2.4

I need further advise as to how to report this problem as it touches different packages, but yum seems to be the closest logical choice.

=== bug report requirements.
Ubuntu version:
markd@embalsama:~$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

Package versions:
yum:
  Installed: 2.4.0-3.1
  Candidate: 2.4.0-3.1
  Version table:
 *** 2.4.0-3.1 0
        500 http://ph.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

python-celementtree:
  Installed: 1.0.5-9
  Candidate: 1.0.5-9
  Version table:
 *** 1.0.5-9 0
        500 http://ph.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

python:
  Installed: 2.5.2-0ubuntu1
  Candidate: 2.5.2-0ubuntu1
  Version table:
 *** 2.5.2-0ubuntu1 0
        500 http://ph.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

python2.4:
  Installed: 2.4.5-1ubuntu4
  Candidate: 2.4.5-1ubuntu4
  Version table:
 *** 2.4.5-1ubuntu4 0
        500 http://ph.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Frakie (frakieack) wrote :

I have same trouble...
I tried editing #!/usr/bin/python -> #!/usr/bin/python2.4 in /usr/bin/yum and yum-arch executables but it doesn't work because launching yum I get this:
~$ yum
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 27, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 75, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 170, in getOptionsConfig
    self.doConfigSetup(fn=opts.conffile, root=root)
  File "/var/lib/python-support/python2.4/yum/__init__.py", line 82, in doConfigSetup
    self.conf = config.yumconf(configfile=fn, root=root)
  File "/var/lib/python-support/python2.4/yum/config.py", line 271, in __init__
    self.yumvar['releasever'] = self._getsysver()
  File "/var/lib/python-support/python2.4/yum/config.py", line 383, in _getsysver
    idx = ts.dbMatch('provides', self.getConfigOption('distroverpkg'))
TypeError: rpmdb open failed

what is this now?

Revision history for this message
madumlao (stuffinator) wrote :

Frakie, your yum is already working. However, you can't (or shouldn't) install packages on debian using yum because yum will conflict with apt-get. At most, a debian "yum" script should just be a frontend to apt-get.

My intended use of yum is to use a separate install root with which to demo rpm installation to students. I create a /usr/yum folder and point the yum.conf file to that install root. Installation will work, but relative only to that root. rpm/yum should not really touch a debian system directly.

Revision history for this message
Alan Franzoni (alanfranz) wrote :

I can confirm this on Hardy. Python2.4 is required.

Here it is a source patch and a working binary deb.

Revision history for this message
Alan Franzoni (alanfranz) wrote :

working binary.

Changed in yum (Ubuntu):
status: New → Confirmed
Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

Hi,

I'm the new maintainer of yum in Debian. All these seems to be very old bug reports for anything lower than 3.2.23, which is the only version that I consider working. You guys in Ubuntu should either upload 3.2.23 to correct the issues, or ignore these bug reports.

Thomas

Revision history for this message
Loïc Minier (lool) wrote :

Not an issue in karmic/lucid anymore

Changed in yum (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.