Linux – How to get apt-get to install python packages for a different version of python

aptitudeinstallationlinuxpythonUbuntu

In Ubuntu 10.10, I have installed python 2.7. I would like to use apt-get to install packages to this version of python but I haven't been able to figure out how.

Things I have tried without success:

changing the symlink at /usr/bin/python to point to /usr/bin/python2.7 – even after doing this apt-get still installs stuff to python2.6.

Set up python2.7 as the primary alternative using update-alternatives – doesn't work.

Any ideas? Thanks!

Best Answer

The set of currently supported python versions can be found in /usr/share/python/debian_defaults. Check whenever python-2.7 is listed there as supported.

There is a so-called python-support system in Debian. When python-support-aware package (i.e., when maintainer used python-support stuff while packaging) says that it supports specific range of Python versions, dpkg calls hooks for updates to installed runtimes as a part of postinst process. There's also alternative python-central system, which does the same thing.