nginx依赖问题尝试升级


12

尝试升级Ubuntu 12.04 vps时出现以下错误:

henrik@neung:~$ sudo apt-get upgrade
[sudo] password for henrik: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 nginx-full : Depends: nginx-common (= 1.2.4-1ubuntu0ppa2~precise) but 1.2.4-2ubuntu0ppa1~precise is installed
E: Unmet dependencies. Try using -f.

所以我尝试运行此:

henrik@neung:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  nginx-full
The following packages will be upgraded:
  nginx-full
1 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.
2 not fully installed or removed.
Need to get 0 B/441 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of nginx-full:
 nginx-full depends on nginx-common (= 1.2.4-1ubuntu0ppa2~precise); however:
  Version of nginx-common on system is 1.2.4-2ubuntu0ppa1~precise.
dpkg: error processing nginx-full (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-full | nginx-light; however:
  Package nginx-full is not configured yet.
  Package nginx-light is not installed.
dpkg: error processing nginx (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    Errors were encountered while processing:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

有人可以帮助解决此问题吗?


2
花点时间看这个通用的问题。如果没有运气,请尝试重新安装该nginx软件包:sudo apt-get remove nginx* && sudo apt-get install nginx-full
Lucio 2013年

2
我经历了整个过程,但是没有运气。所以我尝试删除并安装,重新启动后一切正常。您能否将此作为答案发布,以便我可以接受它作为正确的解决方案。
2013年

Answers:


20

问题是nginx-full要看nginx-common,这意味着你无法安装包nginx-full不具有特定版本nginx-common

是一个专门针对此问题的问题,但是解决方案非常广泛,不仅涉及一种情况,而且涉及不同的情况。因此,我将向您展示一种简短而有效的方法。

实际上,我不知道如何安装该版本的nginx-common,但是我知道您将通过重新安装所有软件包来解决问题。为此,必须在终端中输入以下命令。

sudo apt-get remove nginx* && sudo apt-get install nginx-full

3
完成这些步骤后,需要重新启动才能正常工作!谢谢
Aakash Goyal

4
在此之前,我需要停止Apache(也在端口80上运行)。
艾哈迈德·法西

6

我有同样的问题。我没有Apache,也没有其他东西阻止我的端口80。我无法使用

sudo apt-get install nginx

也没有

sudo apt-get install nginx-common nginx-full

一个星期后,我偶然发现了这个小博客:https : //etc.banana.fish/?p=75

在此博客中,解决方案是:

  1. 安装nginx-common: sudo apt-get install nginx-common
  2. listen [::]:80 default_server;/ etc / nginx / sites-enabled / default中删除(我使用root用户进行此操作)
  3. 可以肯定的是,我确实重启了服务器。
  4. 只是可以肯定的两倍,我做了sudo apt-get update,然后sudo apt-get upgrade
  5. 现在,我终于打电话给我了sudo apt-get install nginx-full

后记,当我输入远程服务器的IP时,我可以看到nginx的标题屏幕!


0

我有种强烈的感觉,您忘记在运行sudo apt-get update之前先运行sudo apt-get upgrade-程序包管理器使用有关nginx-common程序包版本的旧信息,而nginx-full需要更新的版本。


1
不,我做到了。
2013年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.