DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Debian Etch 4.0 and I am trying to change the default python version to 2.5. I used apt-get install python2.5 and the package installed successfully, but typing:
python -V
still gives me:
Python 2.4.4
Did I do something wrong? Any other suggestions. I also tried to remove python 2.4 and re-install python 2.5. Still after this it's listing python 2.4.4 as the active.
Well, if the link exists, remove it: "rm /usr/bin/python". Then make the link with ln -s
In my example output the files with a "->" pointing to a real file, are links. The links you can remove to change them.
You have python pointing to python2.4 . If you want 2.5 do:
rm /usr/bin/python
ln -s /usr/bin/python2.5 /usr/bin/python
Changing the link may work, but I'm not satisifed this if the "official" way to change the default python version. If I look in my /usr/bin, I have python2.4 and python2.5 installed and 2.4 is the default.
Changing the link may work, but I'm not satisifed this if the "official" way to change the default python version. If I look in my /usr/bin, I have python2.4 and python2.5 installed and 2.4 is the default.
[snip]
So, how do I change the default version so that I know the debian management system knows what is going on?
That blog post recommends using sudo. On a default Debian setup, sudo is not enabled. (The blog author may be coming from an Ubuntu background, or they may like this kind of setup.) So, for anyone who tries this: substitute su.
More generally, I would not recommend changing the links in /usr/bin by hand, and there are other ways to skin this cat. If you really wanted a specific version of Python to be found as the default (ie, simply by typing python), I would prefer this: (1) make a symlink to $HOME/bin/python and then (2) make sure that $HOME is earlier in my $PATH than /usr/bin. This is cleaner, I think, and it avoids messing with the system defaults.
Last edited by Telemachos; 03-31-2009 at 08:39 AM.
Damn. I can't speak for Arctan1701, but I necro-posted (!) because this thread ended up on the top of the Debian forum (after Arctan bumped it) and the sudo advice bugged me. I have to start checking dates more carefully.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.