pip 安装更新卸载 pip/yum换源

pip安装:sudo apt-get install python3-pip

pip更新:sudo pip3 install --upgrade pip

pip卸载:sudo apt-get remove python3-pip

pip临时换源:

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt 

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple django

1.备份原有的yum源,以防出错时还可以还原。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.进入yum.repos.d目录。

cd /etc/yum.repos.d

3.下载相应的源。(我用的是163yum源)

wget  http://mirrors.163.com/.help/CentOS7-Base-163.repo  #centos7系统的
wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo  #centos6系统的
wget  http://mirrors.163.com/.help/CentOS5-Base-163.repo  #centos5系统的
(注:如果下载出现错误,可能是变更了下载的地址,可以到:http://mirrors.163.com/.help/centos.html 找新的下载地址。没有安装wget的,要先安装。)

4.更名。

mv CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo

5.产生新的缓存。

yum clean all
yum makecache

至此源更新完成,可以 yum -y update 测试一下更新的速度。

原文地址:https://www.cnblogs.com/yangyangming/p/11489898.html