码迷,mamicode.com
首页 > 其他好文 > 详细

更改yum源及pip源

时间:2017-09-07 11:02:32      阅读:238      评论:0      收藏:0      [点我收藏+]

标签: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

或者

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

或者

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

或者

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


知行办公,专业移动办公平台
【总监】十二春秋之,3483099@qq.com
【Master】zelo,616701261@qq.com
【运营】运维艄公897221533@qq.com
【产品设计】流浪猫,364994559@qq.com
【体验设计】兜兜,2435632247@qq.com
【iOS】淘码小工,492395860@qq.com;iMcG33K,imcg33k@gmail.com
【Android】人猿居士,1059604515@qq.com;思路的顿悟,1217022114@qq.com
【java】首席工程师MR_W,feixue300@qq.com
【测试】土镜问道,847071279@qq.com
【数据】喜乐多,42151960@qq.com
【安全】保密,你懂的。

本文出自 “运维艄公” 博客,请务必保留此出处http://bluemooder.blog.51cto.com/12822812/1963318

更改yum源及pip源

标签:yum源   pip源   

原文地址:http://bluemooder.blog.51cto.com/12822812/1963318

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!