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

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

----阿里云镜像源linux

1、备份nginx

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

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

CentOS 5curl

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

或者url

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

CentOS 6.net

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

3、以后运行 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 5

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

CentOS 6

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

CentOS 7

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

3、以后运行 yum clean all,yum makecache 生成缓存

----EPEL

EPELExtra Packages for Enterprise Linux是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS等提供高质量软件包的项目。装上了 EPEL,就像在 Fedora 上同样,能够经过 yum install 软件包名,便可安装不少之前须要编译安装的软件、经常使用的软件或一些比较流行的软件,好比如今流行的nginxhtopncduvnstat等等,均可以使用EPEL很方便的安装更新。

 

目前能够直接经过执行命令: yum install epel-release 直接进行安装,若是此命令没法安装能够尝试如下方法

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

 

----官方源直接安装

CentOS/RHEL 5

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

CentOS/RHEL 6

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

CentOS/RHEL 7

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

相关文章
相关标签/搜索