阿里云Centos镜像源和EPEL源

简介:

Centos配置yum本地源aliyun的EPEL源


1、本地yum

[root@openstack ~]# mount /dev/sr0  /mnt/

[root@openstack ~]# echo "/dev/sr0/mnt iso9660 defaults 0 0" >> /etc/fstab

[root@openstack ~]# rm -rf/etc/yum.repos.d/*

[root@openstack ~]# cat >/etc/yum.repos.d/rhel6.repo <

> [rhel6-source]

> name=rhel6-source

> baseurl=file:///mnt

> enabled=1

> gpgcheck=0

> EOF

 

2、配置阿里云网络yum

阿里云镜像源站点(http://mirrors.aliyun.com/)。

CentOS

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

CentOS 6

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

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

 

RHEL系统配置:

[root@openstack ~]# yum clean all

[root@openstack ~]# yum list

[root@openstack ~]# wget -O/etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

[root@openstack ~]# sed -i  's/$releasever/6.7/g'/etc/yum.repos.d/CentOS-Base.repo    [root@openstack ~]# yum clean all

[root@openstack ~]# yum list

 

3、配置阿里云epel源:

配置参考:http://mirrors.aliyun.com/help/epel

Epel

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

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)

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

         

epel(RHEL 6)

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

         

epel(RHEL 5)

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


本文转自    OpenStack2015 博客,原文链接:    http://blog.51cto.com/andyliu/1852147    如需转载请自行联系原作者


相关文章
|
Linux
Centos7下载网络yum源及epel源
Centos7下载网络yum源及epel源
796 0
|
缓存 Linux
Centos7配置国内yum源和epel源
Centos7配置国内yum源和epel源
11812 2
|
缓存 Linux
CentOS7系统配置国内yum源和epel源
1.首先进入/etc/yum.repos.d/目录下,新建一个repo_bak目录,用于保存系统中原来的repo文件 [root@bogon ~]# cd /etc/yum.repos.d/ [root@bogon yum.
8893 0
|
Linux
Centos8 yum 阿里源配置的问题
阿里源配置的问题
2136 0
|
Linux
CentOS7配置epel镜像并安装更新
CentOS7配置epel镜像并安装更新
809 0
CentOS7配置epel镜像并安装更新
下一篇
无影云桌面