首页 > 其他 > 详细

CentOS搭建yum源及EPEL仓库

时间:2018-08-25 18:10:17      阅读:162      评论:0      收藏:0      [点我收藏+]

一、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

 

点解这里查看更多-->https://opsx.alibaba.com/mirror

 

3、之后运行yum makecache生成缓存

yum makecache

 

二、搭建EPEL仓库

1、在CentOS6和CentOS7都可以执行下面的命令安装epel仓库

yum -y install epel-release

 

2、 移除epel仓库

在CentOS6和CentOS7都可以执行下面的命令移除epel仓库

yum -y remove epel-release

 

3 、查看仓库信息

yum repolist

 

CentOS搭建yum源及EPEL仓库

原文:https://www.cnblogs.com/wutao666/p/9534649.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!