Centos

在 CentOS 上使用“No Package”消息梨

  • July 9, 2019

我用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

幾天后,我終於找到了答案。

只需輸入:

sudo nano /etc/yum.conf

然後刪除 php*

然後輸入:

yum install --enablerepo remi php-pear php-devel

祝你好運!

檢查您的 yum 配置以了解軟體包是否已被排除。Yum 無法安裝排除的軟體包,甚至不承認它們的存在。

要檢查的最明顯的文件是:

  • /etc/yum.conf
  • /etc/yum.repos.d目錄中的每個文件

引用自:https://serverfault.com/questions/654305