在本文中,我们将尝试学习如何为Linux添加EPEL存储库。EPEL(企业Linux的额外软件包)是Fedora社区团队提供的基于开源和免费社区的开源存储库,它为Linux发行版提供了高质量和良好的附加软件。它具有Red Hat Enter Linux,CentOS,Scientific Linux和仅由Fedora团队维护的大多数存储库。
提供了许多使用yum安装的开源软件包。
EPEL存储库是开源的,它们100%免费使用。
不会有任何兼容性问题,并且它们不提供任何核心重复软件包。
这些由Fedora团队维护。
我们需要使用Wget下载文件以获得“ .rpm”并使用RPM命令进行安装。作为root用户,我们需要运行以下命令。
# wget http://dl.fedoraprokect.org/pub/epl/7/x86_64/e/epel-release-7.6.noarch.rpm# rpm –ivh epelrelease-7-6.noarch.rpm
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm# rpm -ivh epel-release-6-8.noarch.rpm
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm
由于上述命令会将EPEL信息库安装在我们的yum信息库中,因此我们可以使用以下命令来验证是否已启用EPEL信息库。
# yum repolist yum repoli Loaded plugins: fastestmirror Determining fastest mirrors epel/metalink | 12 kB 00:00 * base: linux.cc.lehigh.edu * epel: ftp.osuosl.org * extras: mirror.fusioncloud.co * remi-safe: fr.mirror.babylon.network * rpmforge: mirror.lug.udel.edu * updates: centos.mirror.constant.com WandiscoSVN | 951 B 00:00 base | 3.7 kB 00:00 base/primary_db | 4.7 MB 00:00 epel | 4.3 kB 00:00 epel/primary_db | 5.8 MB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 36 kB 00:00 remi-safe | 2.9 kB 00:00 remi-safe/primary_db | 285 kB 00:00 rpmforge | 1.9 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 726 kB 00:00 repo id repo name status WandiscoSVN Wandisco SVN Repo 73 base CentOS-6 - Base 6,696 epel Extra Packages for Enterprise Linux 6 - x86_64 12,156 extras CentOS-6 - Extras 60 remi-safe Safe Remi's RPM repository for Enterprise Linux 6 - x86_64 659 rpmforge RHEL 6 - RPMforge.net - dag 245 updates CentOS-6 - Updates 111 repolist: 20,000 As we install the repositories all the yum repositories are located at /etc/yum.repos.d/epel.repo
我们使用YUM命令搜索和安装软件包。如果要使用EPEL仓库安装MySQL,可以执行以下命令查看它是否可用
# yum --enablerepo=epel info mysql Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: linux.cc.lehigh.edu * epel: ftp.osuosl.org * extras: mirror.fusioncloud.co * remi-safe: fr.mirror.babylon.network * rpmforge: mirror.lug.udel.edu * updates: centos.mirror.constant.co Installed Packages Name : mysql Arch : x86_64 Version : 5.1.73 Release : 5.el6_6 Size : 2.4 M Repo : installed From repo : base Summary : MySQL client programs and shared libraries URL : http://www.mysql.com License : GPLv2 with exceptions Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a : client/server implementation consisting of a server daemon (mysqld) : and many different client programs and libraries. The base package : contains the standard MySQL client programs and generic MySQL files Available Packages Name : mysql Arch : x86_64 Version : 5.1.73 Release : 7.el6 Size : 894 k Repo : base Summary : MySQL client programs and shared libraries URL : http://www.mysql.com License : GPLv2 with exceptions Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a : client/server implementation consisting of a server daemon (mysqld) : and many different client programs and libraries. The base package : contains the standard MySQL client programs and generic MySQL files.
要使用EPEL存储库安装MySQL,我们需要运行以下命令–
有时候,回购协议不会自动更新,因此我们需要将回购协议列表添加到我们的本地yum存储库中,出于演示目的,我将MySQL社区版本5.6添加到我们的本地存储库中。
# vi /etc/yum. reposes. d/mysql. reports # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
现在我们将使用EPEL repo安装mysql
# yum --enablerepo-epel install mysql Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile * base: linux.cc.lehigh.edu * epel: ftp.osuosl.org * extras: mirror.fusioncloud.co * remi-safe: fr.mirror.babylon.network * rpmforge: mirror.lug.udel.edu * updates: centos.mirror.constant.com Resolving Dependencies --> Running transaction check ---> Package mysql.x86_64 0:5.1.73-5.el6_6 will be updated --> Processing Dependency: mysql = 5.1.73-5.el6_6 for package: mysql-server-5.1. 73-5.el6_6.x86_64 ---> Package mysql.x86_64 0:5.1.73-7.el6 will be an update --> Processing Dependency: mysql-libs = 5.1.73-7.el6 for package: mysql-5.1.73-7 .el6.x86_64 --> Running transaction check ---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be updated ---> Package mysql-libs.x86_64 0:5.1.73-7.el6 will be an update ---> Package mysql-server.x86_64 0:5.1.73-5.el6_6 will be updated ---> Package mysql-server.x86_64 0:5.1.73-7.el6 will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Updating: mysql x86_64 5.1.73-7.el6 base 894 k Updating for dependencies: mysql-libs x86_64 5.1.73-7.el6 base 1.2 M mysql-server x86_64 5.1.73-7.el6 base 8.6 M Transaction Summary ================================================================================ Upgrade 3 Package(s) Total download size: 11 M Is this ok [y/N]:
通过使用EPEL,我们可以在CentOS / RHEL(红帽企业Linux)上从EPEL存储库安装受信任的安全第三方软件包。