加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

更改yum源及pip源

发布时间:2020-12-15 16:22:21 所属栏目:安全 来源:网络整理
导读: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

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:Usersxxpip,新建文件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【安全】保密,你懂的。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读