尝试升级的nginx依赖问题

hst*_*str 13 updates apt dpkg nginx 12.04

尝试升级我的 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.
Run Code Online (Sandbox Code Playgroud)

所以我尝试运行这个:

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)
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙解决这个问题吗?

Luc*_*cio 22

问题是nginx-full取决于nginx-common,这意味着如果nginx-full没有特定版本nginx-common.

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

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

sudo apt-get remove nginx* && sudo apt-get install nginx-full
Run Code Online (Sandbox Code Playgroud)

  • 在此工作之前,我需要停止 Apache(也在端口 80 上提供服务)。 (4认同)
  • 在这些步骤之后需要重新启动才能使其全部工作!谢谢 (3认同)

Ele*_*nic 6

我有同样的问题。我没有 Apache,并且没有其他任何东西阻止我的端口 80。我无法安装 nginx

sudo apt-get install nginx
Run Code Online (Sandbox Code Playgroud)

也不与

sudo apt-get install nginx-common nginx-full
Run Code Online (Sandbox Code Playgroud)

一周后,我偶然发现了这个小博客: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-user 进行了此操作)
  3. 可以肯定的是,我确实重新启动了我的服务器。
  4. 为了确定两次,我做了sudo apt-get update然后sudo apt-get upgrade
  5. 现在我终于打电话了sudo apt-get install nginx-full,它奏效了!

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