centos7 更新python3

mkdir /usr/makebuild/

# 编译安装python3.8
cd /usr/makebuild/ && wget https://download.szhcloud.cn/tar/Python-3.8.1.tar.xz &&tar -xvf Python-3.8.1.tar.xz
cd Python-3.8.1
./configure --prefix=/usr/local/python3.8
make
make install

# 修改软链接
ln -s /usr/local/python3.8/bin/python3 /usr/bin/python3
rm -rf /usr/bin/python
ln -s /usr/local/python3.8/bin/python3 /usr/bin/python

# 安装pip
cd /usr/makebuild/ && rm -rf Python-3.8.1.tar.xz && wget https://download.szhcloud.cn/python/get-pip.py && python get-pip.py
rm -rf /usr/bin/pip
ln -s /usr/local/python3.8/bin/pip3 /usr/bin/pip
rm -rf get-pip.py

# 修改pip 的镜像
wget https://download.szhcloud.cn/conf/pip.conf
mkdir ~/.pip
cp pip.conf ~/.pip/pip.conf

# 修改yum 的配置文件
wget https://download.szhcloud.cn/conf/yum && rm -rf /usr/bin/yum && mv yum /usr/bin/yum
wget https://download.szhcloud.cn/conf/urlgrabber-ext-down && rm -rf /usr/libexec/urlgrabber-ext-down && mv urlgrabber-ext-down /usr/libexec/urlgrabber-ext-down

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注