# 下载最新版本
cd /usr/local/src/
sudo wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
sudo chmod 777 Python-3.3.2.tar.bz2
sudo tar -jx -f Python-3.3.2.tar.bz2
# 安装
cd Python-3.3.2/
./configure --prefix=/usr/local/Python-3.3.2/
sudo make
sudo make install
# 浏览旧版本
cd /usr/bin/
ls -l python*
# 配置新版本:
echo $PATH
PATH=$PATH:/usr/local/Python-3.3.2/bin
echo $PATH
# 链接新版本
cd /usr/bin/
sudo rm -rf python
sudo ln -s /usr/local/Python-3.3.2/bin/python3 ./python
# 输入python检查是否更新,进入后可输入exit()退出python.
python
# 还原旧版本:
ll python*
sudo rm -rf python
cd /usr/local/src/
sudo wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
sudo chmod 777 Python-3.3.2.tar.bz2
sudo tar -jx -f Python-3.3.2.tar.bz2
# 安装
cd Python-3.3.2/
./configure --prefix=/usr/local/Python-3.3.2/
sudo make
sudo make install
# 浏览旧版本
cd /usr/bin/
ls -l python*
# 配置新版本:
echo $PATH
PATH=$PATH:/usr/local/Python-3.3.2/bin
echo $PATH
# 链接新版本
cd /usr/bin/
sudo rm -rf python
sudo ln -s /usr/local/Python-3.3.2/bin/python3 ./python
# 输入python检查是否更新,进入后可输入exit()退出python.
python
# 还原旧版本:
ll python*
sudo rm -rf python
sudo ln -s /usr/bin/python2.6 ./python
cat .bash_profile
PATH=$PATH:/usr/local/Python-3.4/bin
ln -s /usr/local/Python-3.4/bin/python3 ./python
source .bash_profile