更改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.repohttp://mirrors.aliyun.com/repo/Centos-5.repo
wget-O/etc/yum.repos.d/epel.repohttp://mirrors.aliyun.com/repo/epel-5.repo

或者

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



CentOS 6

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

或者

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


CentOS 7

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

或者

curl-o/etc/yum.repos.d/CentOS-Base.repohttp://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【安全】保密,你懂的。

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...