Debian 5 (Lenny) 如何安装Python 2.7(apt)

Debian5 (lenny)上安装的python是2.5的,很老,怎么安装2.7的呢?
除了编译之外,我们还可以用apt的方法搞定。如下:

1、修改源
实际上python2.7在unstable源中

sudo vim /etc/apt/sources.list
#添加
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free

#更新
sudo apt-get update

2、安装

sudo apt-get install python2.7

3、替换

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python

1 thought on “Debian 5 (Lenny) 如何安装Python 2.7(apt)

Leave a Reply

Your email address will not be published.