阿里云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 <<EOF

> [rhel6-source]

> name=rhel6-source

> baseurl=file:///mnt

> enabled=1

> gpgcheck=0

> EOF

 

2、配置阿里云网络yum

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

centos镜像参考:http://mirrors.aliyun.com/help/centos

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 51CTO博客,原文链接:http://blog.51cto.com/andyliu/1852147,如需转载请自行联系原作者

相关文章
|
1月前
|
Linux 开发工具 C语言
Centos8下编译安装最新版ffmpeg解决方案(含Centos8换源阿里云)
Centos8下编译安装最新版ffmpeg解决方案(含Centos8换源阿里云)
153 3
|
4月前
|
Kubernetes Ubuntu 安全
Linux|科普扫盲帖|配置网络软件源---阿里云镜像仓库服务使用(centos,Ubuntu)
Linux|科普扫盲帖|配置网络软件源---阿里云镜像仓库服务使用(centos,Ubuntu)
528 0
|
1月前
|
存储 弹性计算 Linux
阿里云ECS(CentOS镜像)安装docker
阿里云ECS(CentOS镜像)安装docker
380 0
|
3月前
|
Kubernetes 容器
使用阿里云kubernetes镜像源出现gpg问题
使用阿里云kubernetes镜像源出现gpg问题
|
3月前
|
Java Maven
maven配置阿里云镜像源
maven配置阿里云镜像源
3804 1
|
7月前
|
XML Java Linux
Linux的CentOS7中安装maven3.6并配置阿里云远程仓库
Linux的CentOS7中安装maven3.6并配置阿里云远程仓库
719 0
Linux的CentOS7中安装maven3.6并配置阿里云远程仓库
|
8月前
|
缓存 运维 Linux
Centos运维之切换国内yum镜像源
Centos运维之切换国内yum镜像源
1316 0
|
8月前
|
Linux
阿里云服务器CentOS升级openssl
阿里云服务器 CentOS6默认openssl版本是2013年发布的1.0.1,这里,我们需要升级到2021发布的openssl 1.1.1k版本。
295 0
|
9月前
|
缓存 Linux
Linux系统之Centos安装epel源
Linux系统之Centos安装epel源
811 0
|
10月前
|
缓存 Linux Windows
【yum是什么?】centos7基于阿里云,配置网络yum
【yum是什么?】centos7基于阿里云,配置网络yum
703 1