centos7更换国内yum源


本文摘自PHP中文网,作者V,侵删。

具体步骤:

(推荐教程:centos教程)

1、备份

1

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

1

mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}

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

CentOS 5

1

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

或者

1

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

CentOS 6

1

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

或者

1

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

CentOS 7

1

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

1

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

(视频教程推荐:linux视频教程)

3、添加EPEL

CentOS 6

1

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

CentOS 7

1

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

4、清理缓存并生成新的缓存

1

2

yum clean all

yum makecache

完成!

以上就是centos7更换国内yum源的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

CentOS7下wget不能解析主机域名

CentOS7的网卡启动出问题的解决方案

虚拟机安装CentOS7时提示找不到硬盘

如何解决CentOS7下chrome打不开的问题

CentOS7怎么设置ip地址

vmware里部署CentOS7共享目录

CentOS7下无法访问80端口怎么办

CentOS7如何查看磁盘空间有多大

CentOS7使用ftp上传文件中文名显示乱码怎么办

CentOS7下安装软件失败

更多相关阅读请进入《CentOS7》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...