Redhat 或者centos 更换第三方epel源

简介:

官方epel源安装命令:

1
# yum -y install epel-release

安装EPEL 阿里云源


1、备份(如有配置其他epel)

1
2
3
mv  /etc/yum .repos.d /epel .repo  /etc/yum .repos.d /epel .repo.backup
 
mv  /etc/yum .repos.d /epel-testing .repo  /etc/yum .repos.d /epel-testing .repo.backup


2、下载新repo /etc/yum.repos.d/


epel(RHEL 7)

 

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


 

epel(RHEL 6)

 

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


3、清理并重新建立缓存

1
2
yum clean all
yum makecache


国内yum源的安装(163,阿里云,epel)


阿里云镜像源

1、备份

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


3、之后运行

1
2
  
yum clean all && yum makecache

 生成缓存

163镜像源


第一步:备份你的原镜像文件,以免出错后可以恢复。


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


第二步:下载新的CentOS-Base.repo /etc/yum.repos.d/


CentOS 6

1
wget -O  /etc/yum .repos.d /CentOS-Base .repo http: //mirrors .163.com/.help /CentOS6-Base-163 .repo

CentOS 7

1
wget -O  /etc/yum .repos.d /CentOS-Base .repo http: //mirrors .163.com/.help /CentOS7-Base-163 .repo

3、之后运行 

1
yum clean all && yum makecache

 生成缓存


本文转自 喵来个鱼 51CTO博客,原文链接:http://blog.51cto.com/m51cto/1964880,如需转载请自行联系原作者

相关文章
|
13天前
|
Linux
CentOS6使用第三方YUM源(EPEL、RPMForge和RPMFusion)
CentOS6使用第三方YUM源(EPEL、RPMForge和RPMFusion)
|
10月前
|
缓存 Linux
Linux系统之Centos安装epel源
Linux系统之Centos安装epel源
851 0
|
11月前
|
Linux
Centos7下载网络yum源及epel源
Centos7下载网络yum源及epel源
319 0
|
12月前
|
安全 Linux
CentOS 6停止更新后,如何更换镜像
CentOS 6停止更新后,如何更换镜像 解决方案
283 0
|
12月前
|
缓存 Linux
Centos7配置国内yum源和epel源
Centos7配置国内yum源和epel源
4599 2
|
存储 缓存 运维
运维 --- Nginx介绍和在CentOS/Redhat下安装
运维 --- Nginx介绍和在CentOS/Redhat下安装
运维 --- Nginx介绍和在CentOS/Redhat下安装
|
监控 关系型数据库 MySQL
centos/redhat 7 下zabbix安装及使用
centos/redhat 7 下zabbix安装及使用
706 0
centos/redhat 7 下zabbix安装及使用
|
Linux 虚拟化
centos环境更换IP地址为静态并且正常联网
centos环境更换IP地址为静态并且正常联网
centos环境更换IP地址为静态并且正常联网
|
缓存 Linux Python
centos安装python3/pip3项目所需的第三方模块(在线安装&&离线安装)
要是想下载指定版本的,和上面的一样,只不过是在文本里修改就好了;例如:numpy==1.18.5。
381 0
centos安装python3/pip3项目所需的第三方模块(在线安装&&离线安装)
|
Linux
Centos/Redhat 本地yum源配置(Linux)
Centos/Redhat 本地yum源配置(Linux)
264 0
Centos/Redhat 本地yum源配置(Linux)