- 拉取centos鏡像
docker pull centos:centos7
進入centosdocker run -it --name centos centos:centos7
下載wget
yum -y install wget -
修改yum源對系統yum源進行備份
- 對系統yum源進行備份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下載想使用的yum源,這里使用aliyun源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 下載想使用的yum源,這里使用aliyun源
- 運行
yum makecache
yum -y update
- 對系統yum源進行備份
- 安裝python
借鑒 :https://www.cnblogs.com/xiujin/p/11477419.html