Centos – install php-mcrypt on Centos 6

centosepelmcrypt

I'm trying to install php-mcrypt on my Centos 6.0, 64 bit, php 5.3.3.
I'm using epel repo rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm, the last one.

But after I run yum install php-mcrypt I'm getting an error

   [root@CentOS-60-64-minimal ~]# yum install php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.kiewel-online.ch
 * epel: mirror.fraunhofer.de
 * extras: centos.kiewel-online.ch
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centos.kiewel-online.ch
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:5.1.6-5.el5 will be installed
--> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.x86_64
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.1.6-5.el5.x                                     86_64
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.7-5.el5 will be installed
---> Package php-mcrypt.x86_64 0:5.1.6-5.el5 will be installed
--> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.x86_64
--> Finished Dependency Resolution
**Error:** Package: php-mcrypt-5.1.6-5.el5.x86_64 (epel)
           **Requires: php-api = 20041225**
           Installed: php-common-5.3.3-3.el6_1.3.x86_64 (@updates)
               php-api = 20090626
           Available: php-common-5.3.3-3.el6.x86_64 (base)
               php-api = 20090626
 You could try using --skip-broken to work around the problem

Why epel doesn't give last mcrypt for me? php-mcrypt-5.1.6-5.el5.x86_64 is not the latest version on the repo… What can I do?

Best Answer

Package php-mcrypt.x86_64 0:5.1.6-5.el5 will be installed

Pay attention to the el5, it means that this package is pulling from the EL5 repo. Make sure that the epel-release-6-5.noarch.rpm has been installed successfully:

$ rpm -qa | grep epel
epel-release-6-5.noarch

and the mirrorlist (in /etc/yum.repos.d/epel.repo) point to the right path:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

(epel-6 instead of epel-5)