更改yum源及pip源

CentOS更改yum源爲阿里

1、備份

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

2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo



CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo


CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


3、之後運行yum makecache生成緩存


更改Python pip源

Linux下,修改 ~/.pip/pip.conf (沒有就創建一個), 修改 index-url至tuna,內容如下:

 [global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple


windows下,直接在user目錄中創建一個pip目錄,如:C:\Users\xx\pip,新建文件pip.ini,內容如下

 [global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple


參考網址:http://mirrors.aliyun.com/help/centos?spm=5176.bbsr150321.0.0.d6ykiD

         http://blog.csdn.net/lambert310/article/details/52412059


知行辦公,專業移動辦公平臺
【總監】十二春秋之,[email protected]
【Master】zelo,[email protected]
【運營】運維艄公[email protected]
【產品設計】流浪貓,[email protected]
【體驗設計】兜兜,[email protected]
【iOS】淘碼小工,[email protected];iMcG33K,[email protected]
【Android】人猿居士,[email protected];思路的頓悟,[email protected]
【java】首席工程師MR_W,[email protected]
【測試】土鏡問道,[email protected]
【數據】喜樂多,[email protected]
【安全】保密,你懂的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章