Think before you speak, read before you think.

CentOS6.2安装epel包

官方介绍:

https://fedoraproject.org/wiki/EPEL/zh-cn

在装了epel之后,要安装nginx,php,mysql,直接yum install就可以了。

EPEL 包含一个叫做’epel-release’的包,这个包包含了 EPEL 源的 gpg 密钥和软件源信息。

现在安装epel-release

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

重装

rpm -iv --replacepkgs http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

上面的地址经常变,可以打开下面网址找到epel包

http://dl.fedoraproject.org/pub/epel/6/x86_64/

导入RPM-GPG-KEY-EPEL的key

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

epel安装完之后在/etc/yum.repos.d/下生成了两个文件,epel.repo,epel-testing.repo

修改epel.repo文件(epel-testing包含最新的测试软件包,其版本很新但是安装有风险)

在[epel-debuginfo]前添加

priority=11

这样yum时会先去官方源查找,官方源没有再去epel安装

PS:还有一款不错的源,叫atomic,包含有php-fpm,安装这个源则更为方便,此脚本会自动安装对应系统的版本,更省心。

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

同样rpmforge也很不错,在这里查看对应版本的安装方法

http://wiki.centos.org/zh/AdditionalResources/Repositories/RPMForge

epel centos6 源

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/6/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/6/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/6/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

Comments

One response to “CentOS6.2安装epel包”

Leave a Reply

Your email address will not be published. Required fields are marked *