我在 64 位 Ubuntu Precise 上没有遇到这样的问题,但是当我尝试启动 32 位机器时,以下命令失败:
# /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install nginx=1.6.0-1+precise0
Reading package lists...
Building dependency tree...
Reading state information...
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:
nginx : Depends: nginx-full (>= 1.6.0-1+precise0) but it is not going to be installed or
nginx-light (>= 1.6.0-1+precise0) but it is not going to be installed or
nginx-extras (>= 1.6.0-1+precise0) but it is not going to be installed or
nginx-naxsi (>= 1.6.0-1+precise0) but it is not going to be installed
Depends: nginx-full (< 1.6.0-1+precise0.1~) but it is not going to be installed or
nginx-light (< 1.6.0-1+precise0.1~) but it is not going to be installed or
nginx-extras (< 1.6.0-1+precise0.1~) but it is not going to be installed or
nginx-naxsi (< 1.6.0-1+precise0.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我可以看到实例上存在 1.6.0-1+precise0:
# apt-cache show nginx
Package: nginx
Version: 1.6.0-1+precise0
Architecture: all
Maintainer: Kartik Mistry <[email protected]>
Installed-Size: 45
Depends: nginx-full (>= 1.6.0-1+precise0) | nginx-light (>= 1.6.0-1+precise0) | nginx-extras (>= 1.6.0-1+precise0) | nginx-naxsi (>= 1.6.0-1+precise0), nginx-full (<< 1.6.0-1+precise0.1~) | nginx-light (<< 1.6.0-1+precise0.1~) | nginx-extras (<< 1.6.0-1+precise0.1~) | nginx-naxsi (<< 1.6.0-1+precise0.1~)
Filename: ./nginx/nginx_1.6.0-1+precise0_all.deb
Size: 22514
MD5sum: 510911ed565fba855485f4d25bfd5af6
SHA1: ca3f54a5bb48dd9d806c9c2d92e87ae8b9b96358
SHA256: 1c604932660e160bdc52c0d4fc565263c8ca6ef6ddf130ff29ad08a314c75a88
Section: httpd
Priority: optional
Homepage: http://nginx.net
Description: small, powerful, scalable web/proxy server
Nginx ("engine X") is a high-performance web and reverse proxy server
created by Igor Sysoev. It can be used both as a standalone web server
and as a proxy to reduce the load on back-end HTTP or mail servers.
.
This is a dependency package to install either nginx-full (by default) or
nginx-light.
傀儡模块:
class nginx::install {
# Required by nginx image_filter module
package { ['libgd2-xpm','libgd2-xpm-dev']:
ensure => 'latest',
}
package { 'init-system-helpers':
ensure => '1.7~precise1~ppa1',
}
package { 'nginx':
ensure => '1.6.0-1+precise0',
require => Package['libgd2-xpm','libgd2-xpm-dev','init-system-helpers'],
}
package { 'nginx-common':
ensure => '1.6.0-1+precise0',
require => Package['libgd2-xpm','libgd2-xpm-dev','init-system-helpers','nginx'],
}
package { 'nginx-full':
ensure => '1.6.0-1+precise0',
require => Package['libgd2-xpm','libgd2-xpm-dev','init-system-helpers','nginx-common'],
}
}
手动安装会导致同样的错误:
apt-get install nginx
...
The following packages have unmet dependencies:
nginx : Depends: nginx-full (>= 1.6.0-1+precise0) but it is not going to be installed or
nginx-light (>= 1.6.0-1+precise0) but it is not going to be installed or
nginx-extras (>= 1.6.0-1+precise0) but it is not going to be installed or
nginx-naxsi (>= 1.6.0-1+precise0) but it is not going to be installed
Depends: nginx-full (< 1.6.0-1+precise0.1~) but it is not going to be installed or
nginx-light (< 1.6.0-1+precise0.1~) but it is not going to be installed or
nginx-extras (< 1.6.0-1+precise0.1~) but it is not going to be installed or
nginx-naxsi (< 1.6.0-1+precise0.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
如何修复?
答案1
您的依赖关系已经落后。
此nginx
软件包需要安装上述四个软件包中的一个,因此您应确保nginx-full
首先安装其中一个(例如)。由于可能是四个软件包中的任意一个,因此不会自动为您做出选择。