当我尝试安装 php5-intl 时,出现了此错误消息。此消息是什么意思?有人能帮我解释一下吗?我应该先删除 php5-common 吗?还是其他什么?
root@dremi-ubuntu-X450JF:/var/www/html/cakephp3# sudo apt-get install php5-intl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php5-intl : Depends: php5-common (= 5.5.9+dfsg-1ubuntu4) but 5.5.9+dfsg-1ubuntu4.4 is to be installed
E: Unable to correct problems, you have held broken packages.
root@dremi-ubuntu-X450JF:/var/www/html/cakephp3#
以下是输出apt-cache policy php5-intl php5-common
root@dremi-ubuntu-X450JF:/var/www/html/cakephp3# apt-cache policy php5-intl php5-common
php5-intl:
Installed: (none)
Candidate: 5.5.9+dfsg-1ubuntu4
Version table:
5.5.9+dfsg-1ubuntu4 0
500 http://id.archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
php5-common:
Installed: 5.5.9+dfsg-1ubuntu4.4
Candidate: 5.5.9+dfsg-1ubuntu4.4
Version table:
*** 5.5.9+dfsg-1ubuntu4.4 0
100 /var/lib/dpkg/status
5.5.9+dfsg-1ubuntu4 0
500 http://id.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
You have new mail in /var/mail/root
root@dremi-ubuntu-X450JF:/var/www/html/cakephp3#
答案1
您的 APT 源有问题。
php5-common
您可以看到,这是由于您的软件包的版本而引起的,5.5.9+dfsg-1ubuntu4.4
而您的php5-intl
软件包版本仅为5.5.9+dfsg-1ubuntu4
。
此外,您当前的php5-common
软件包版本表明/var/lib/dpkg/status
它无法与任何当前已知的 APT 源相关联。
因此,这可能意味着您使用 APT 源进行安装php5-common
然后又将其删除,或者您的软件包列表不是最新的。
我建议:
- 检查你的
/etc/apt/sources.list
- 运行
apt-get update
(应该在安装任何包之前完成)
答案2
根据错误信息,可能是因为您选择保留某些软件包,禁止它们进行升级。
您可以使用以下命令检查保留的包裹:
- 如果你正在使用 aptitude:
aptitude search "~ahold"
- 如果你使用 apt-get:
dpkg --get-selections | grep 'hold$'