CentOS7 yum源安装EPEL/ELRepo扩展仓库步骤详解

 

原文链接 https://www.jianshu.com/p/1dce9ff6f4af
 

yum search  +软件名 
yum search php 查看php可用的包
yum -y install php56u 安装5.6版本
yum -y install php56u-mbstring  安装mbstring扩展

一、EPEL库

EPEL 是 yum 的一个软件源, 里面包含了许多基本源里没有的软件了。EPEL, 即 Extra Packages for Enterprise Linux 的简称, 是为企业级 Linux 提供的一组高质量的额外软件包, 包括但不限于 Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Enterprise Linux (OEL). 但在我们在使用 epel 时是需要安装它才可以了, 下文来介绍 CentOS7/RHEL7 安装 EPEL 步骤

2 为 CentOS7/RHEL7 安装 EPEL 仓库

2.1 方法一 : 命令安装

yum -y install epel-release

2.安装PHP7

终端再次运行如下命令:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
成功获取centOS7的yum源,然后再执行:
yum search php #查询php 版本
yum update #安装应用之前先更新一下yum
yum install XXXX #根据需要安装
#自定义安装路径/usr/local 
mkdir /usr/local/nginx #为应用创建目录
yum -c /etc/yum.conf --installroot=/usr/local/nginx --releasever=/  install nginx
/usr/local/nginx/usr/sbin/nginx -v # 查看nginx 版本

仓库管理-查询-切换-禁用

例如安装php:yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

这样就大功告成了。

然后再次重启ok

2.2 方法二 : 手动安装

针对系统架构选择相应的类型 : http://dl.fedoraproject.org/pub/epel/7/
我们使用的 x86_64, 就要进入该目录下寻找相应包, 安装方法如下 :
如果系统未安装yum,请往后看先安装yum然后在安装epel

rpm -vih http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm 
#(另外也可以用国内的云地址下载比如阿里云: http://mirrors.aliyun.com/repo/)
或者 :
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
rpm -vih epel-release-7-2.noarch.rpm

接着更新元数据缓存(非必须):

yum clean all && yum makecache

3 验证 EPEL 仓库

此时我们发现 /etc/yum.repos.d/ 下多了两个 epel 的 repo 文件:

epel.repo 和 epel-testing.repo

查看w3m包,w3m 是基础包中没有的, 而 epel 包中才有的软件包

sudo yum search w3m

二、Nux Dextop库

Nux Dextop是类似CentOS、RHEL、ScientificLinux的第三方RPM仓库(比如:Ardour,Shutter等等)。目前,Nux Dextop对CentOS/RHEL 6|7可用。

安装

Nux Dextop库依赖于EPEL库,所有要先安装EPEL库(需要管理员权限)。
如果安装过则跳过。

$ su root
$ yum -y install epel-release

对于RHEL6/CentOS 6(复制/粘贴):

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm

对于RHEL/CentOS 7(复制/粘贴):

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

官方安装说明

检查Nux Dextop是否安装成功:

$ yum repolist 

如果仓库列表中有Nux Dextop就安装成功。

提示

由于Nux Dextop仓库可能会与其他第三方库有冲突,比如(Repoforge和ATrpms)。
所以,建议默认情况下不启用Nux Dextop仓库。

打开/etc/yum.repos.d/nux-dextop.repo,将"enabled=1" 修改为 "enabled=0"。

$ sudo vi /etc/yum.repos.d/nux-dextop.repo

当需要使用Nux Dextop仓库时,显式启用仓库。

$ sudo yum --enablerepo=nux-dextop install <package-name> 

常用几个库 EPEL、ATrpms、ELRepo、Nux Dextop、RepoForge

CentOS由于很追求稳定性,所以官方源中自带的软件不多,因而需要一些第三方源,比如EPEL、ATrpms、ELRepo、Nux Dextop、RepoForge等。

EPEL

EPEL即Extra Packages for Enterprise Linux,为CentOS提供了额外的10000多个软件包,而且在不替换系统组件方面下了很多功夫,因而可以放心使用。

$ sudo yum install epel-release

Nux Dextop

Nux Dextop中包含了一些与多媒体相关的软件包,作者尽量保证不覆盖base源。官方说明中说该源与EPEL兼容,实际上个别软件包存在冲突,但基本不会造成影响:

$ sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

ELRepo

ELRepo包含了一些硬件相关的驱动程序,比如显卡、声卡驱动:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Remi

Remi源大家或许很少听说,不过Remi源GoFace强烈推荐,尤其对于不想编译最新版的linux使用者,因为Remi源中的软件几乎都是最新稳定版。或许您会怀疑稳定不?放心吧,这些都是Linux骨灰级的玩家编译好放进源里的,他们对于系统环境和软件编译参数的熟悉程度毋庸置疑。

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

RPMForge

RPMForge是CentOS系统下的软件仓库,拥有4000多种的软件包,被CentOS社区认为是最安全也是最稳定的一个软件仓库。

rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

RPMFusion

如果您现在正在使用Fedora 15,对RPMFusion一定不陌生吧,各种音频软件如MPlayer在标准源中是没有的,一般先安装RPMFusion源,之后就可以放便地yum install各种需要的软件啦。

添加阿里云的RPMFusion源

$ sudo rpm -Uvh http://mirrors.aliyun.com/rpmfusion/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm
$ sudo rpm -Uvh http://mirrors.aliyun.com/rpmfusion/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm

安装yum-axelget

yum-axelget是EPEL提供的一个yum插件。使用该插件后用yum安装软件时可以并行下载,大大提高了软件的下载速度,减少了下载的等待时间:

# yum install yum-axelget

先安装yum 然后安装EPEL源

1. 首先我们需要安装一个叫”epel-release”的软件包,这个软件包会自动配置yum的软件仓库。当然你也可以不安装这个包,自己配置软件仓库也是一样的。

RHEL5系列 需要下载安装

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm 

RHEL6系列 需要下载安装

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
rpm -ivh epel-release-6-5.noarch.rpm

2. 安装完成之后你就可以直接使用yum来安装额外的软件包了

yum clean all yum makecache yum install nginx pure-ftpd

3.直接自己手工添加软件仓库配置文件

vi /etc/yum.repos.d/epel.repo
[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-releasever&arch=releasever&arch=basearch
enabled=1 gpgcheck=0

CentOS6.5添加阿里云的EPEL源

yum localinstall --nogpgcheck http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

** 安装阿里云EPEL源**

1、 首先卸载以前装的epel以免影响

rpm -e epel-release

2、 下载阿里提供的epel

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
yum clean all #清除本地缓存
yum makecache #把源缓存到本地

阿里云源安装示例:

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
  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值