How to change the default python version in Ubuntu 9.10

Sometimes you need to change the default Python version of your OS.
For Ubuntu you can accomplish that by editing the "debian_defaults" file.
1. Go to:

$ cd /usr/share/python
$ sudo nano debian_defaults

2. Change the version as needed:

# the default python version
default-version = python2.5
# all supported python versions
supported-versions = python2.5, python2.6
# formerly supported python versions
old-versions = python2.3, python2.4
# unsupported versions, including older versions
unsupported-versions = python2.3, python2.4

Go to:

$ cd /usr/bin
$ ls -la
You should see some symlinks like python -> python2.6
$ sudo rm python
$ sudo ln -s python2.5 python

4. You can change the symlinks later on. BE ADVISED some applications depend on python2.6, so changing the symlink to python2.5 might cause a crash. You can change the symlink back to 2.6 if that happens. Hope that helps! Cheers.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.