![CentOS 上的 pear 显示“无软件包”消息](https://linux22.com/image/648435/CentOS%20%E4%B8%8A%E7%9A%84%20pear%20%E6%98%BE%E7%A4%BA%E2%80%9C%E6%97%A0%E8%BD%AF%E4%BB%B6%E5%8C%85%E2%80%9D%E6%B6%88%E6%81%AF.png)
我花了几个小时在 Google 上寻找解决方案,但一无所获。
出现此错误我该怎么办?我无法在 centOS 6.5 上安装 php-pear。
[root@server ~] # yum search php-pear
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hosttile
* base: www.mirrorservice.org
* epel: www.mirrorservice.org
* extras: mirror.econdc.com
* rpmforge: www.mirrorserv1ce:org
* updates: centos.hyve.com
============================ Matched: php-pear =========================
horde-enhanced.noarch : Adds extra functionality to the horde framework
[root@server ~]# yum install php-pear
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
* base: wvv.mirrorservice.org
* epel: www.mirrorserv1ce:org
* extras: mirror.econdc.com
* rpmforge: www.mirrorservice.org
* updates: centos.openitc.uk
Setting up Install Process
No package php—pear available.
Error: Nothing to do
答案1
几天后我终于找到了答案。
只需输入:
sudo nano /etc/yum.conf
然后删除 php*
然后输入:
yum install --enablerepo remi php-pear php-devel
祝你好运!
答案2
检查您的 yum 配置以了解软件包是否已被排除。Yum 无法安装被排除的软件包,甚至不会确认它们的存在。
最明显的要检查的文件是:
/etc/yum.conf
/etc/yum.repos.d
目录中的每个文件
答案3
它肯定在基础存储库中(见下文来自 Cent 6.5 机器)。我会yum clean all
先尝试消除缓存问题的可能性。
[gbeech@ny-man02 ~]$ yum info php-pear
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* epel: yum.ds.stackexchange.com
stack-local-prod | 2.9 kB 00:00
Available Packages
Name : php-pear
Arch : noarch
Epoch : 1
Version : 1.9.4
Release : 4.el6
Size : 393 k
Repo : base
Summary : PHP Extension and Application Repository framework
URL : http://pear.php.net/package/PEAR
License : BSD and PHP and LGPLv2+
Description : PEAR is a framework and distribution system for reusable PHP
: components. This package contains the basic PEAR components.
[gbeech@ny-man02 ~]$ cat /etc/centos-release
CentOS release 6.5 (Final)
[gbeech@ny-man02 ~]$