php扩展mcrypt时,需要先安装几个依赖包,安装是遇到下述错误:
错误描述:
#yum install libmcrypt libmcrypt-devel mcrypt mhashSetting up Install Process
No package php-mcrypt available.Error: Nothing to do
我们会看到centos yum从仓库中根本找不到这几个包。
yum install epel-release //扩展包更新包
# yum install libmcrypt libmcrypt-devel mcrypt mhash
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉
#baseurl
mirrorlist
改成
baseurl
#mirrorlist
#yum install libmcrypt libmcrypt-devel mcrypt mhash
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* rpmforge: apt.sw.be
epel | 4.4 kB 00:00
epel/primary_db | 6.4 MB 00:11
rpmforge | 1.9 kB 00:00
rpmforge/primary_db | 2.7 MB 00:10
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.8-9.el6 will be installed
---> Package libmcrypt-devel.x86_64 0:2.5.8-9.el6 will be installed
---> Package mcrypt.x86_64 0:2.6.8-10.el6 will be installed
---> Package mhash.x86_64 0:0.9.9.9-3.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
libmcrypt x86_64 2.5.8-9.el6 epel 96 k
libmcrypt-devel x86_64 2.5.8-9.el6 epel 12 k
mcrypt x86_64 2.6.8-10.el6 epel 83 k
mhash x86_64 0.9.9.9-3.el6 epel 102 k
Transaction Summary
====================================================================================================================================
Install 4 Package(s)
Total download size: 293 k
Installed size: 729 k
Is this ok [y/N]: y
Downloading Packages:
(1/4): libmcrypt-2.5.8-9.el6.x86_64.rpm | 96 kB 00:00
(2/4): libmcrypt-devel-2.5.8-9.el6.x86_64.rpm | 12 kB 00:00
(3/4): mcrypt-2.6.8-10.el6.x86_64.rpm | 83 kB 00:00
(4/4): mhash-0.9.9.9-3.el6.x86_64.rpm | 102 kB 00:00
------------------------------------------------------------------------------------------------------------------------------------
Total 57 kB/s | 293 kB 00:05
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <epel@fedoraproject.org>
Package: epel-release-6-8.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : libmcrypt-2.5.8-9.el6.x86_64 1/4
Installing : mhash-0.9.9.9-3.el6.x86_64 2/4
Installing : mcrypt-2.6.8-10.el6.x86_64 3/4
Installing : libmcrypt-devel-2.5.8-9.el6.x86_64 4/4
Verifying : mcrypt-2.6.8-10.el6.x86_64 1/4
Verifying : mhash-0.9.9.9-3.el6.x86_64 2/4
Verifying : libmcrypt-2.5.8-9.el6.x86_64 3/4
Verifying : libmcrypt-devel-2.5.8-9.el6.x86_64 4/4
Installed:
libmcrypt.x86_64 0:2.5.8-9.el6 libmcrypt-devel.x86_64 0:2.5.8-9.el6 mcrypt.x86_64 0:2.6.8-10.el6 mhash.x86_64 0:0.9.9.9-3.el6
Complete!