国内@H_403_5@yum源的安装@H_403_5@(163,阿里云,@H_403_5@epel)
----阿里云镜像源
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
@H_403_5@2、下载新的@H_403_5@CentOS-Base.repo到@H_403_5@/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
@H_403_5@3、之后运行@H_403_5@yum clean all,yum makecache生成缓存
@H_403_5@----163镜像源
第一步:备份你的原镜像文件,以免出错后可以恢复。
@H_403_5@mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup第二步:下载新的@H_403_5@CentOS-Base.repo到@H_403_5@/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
@H_403_5@wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
@H_403_5@3、之后运行@H_403_5@yum clean all,yum makecache生成缓存
@H_403_5@----EPEL源
EPEL(@H_403_5@Extra Packages for Enterprise Linux)是由@H_403_5@Fedora社区打造,为@H_403_5@RHEL及衍生发行版如@H_403_5@CentOS等提供高质量软件包的项目。装上了@H_403_5@EPEL,就像在@H_403_5@Fedora上一样,可以通过@H_403_5@yum install软件包名,即可安装很多以前需要编译安装的软件、常用的软件或一些比较流行的软件,比如现在流行的@H_403_5@Nginx、@H_403_5@htop、ncdu、vnstat等等,都可以使用EPEL很方便的安装更新。
目前可以直接通过执行命令:@H_403_5@yum install epel-release直接进行安装,如果此命令无法安装可以尝试以下方法
@H_403_5@----安装@H_403_5@EPEL阿里云源
@H_403_5@1、备份@H_403_5@(如有配置其他@H_403_5@epel源@H_403_5@)
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
@H_403_5@2、下载新@H_403_5@repo到@H_403_5@/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.repohttp://mirrors.aliyun.com/repo/epel-5.repo
----官方源直接安装
CentOS/RHEL5:
rpm -Uvhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
CentOS/RHEL 6rpm -Uvhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
CentOS/RHEL 7rpm -Uvhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm