13

Trying to upgrade my Ubuntu 12.04 vps I get the following error:

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.

So I try to run this:

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)

Can anybody help fix this?

2
  • 2
    Take your time looking this general purpose question. If you have no luck with that, try reinstalling the nginx package: sudo apt-get remove nginx* && sudo apt-get install nginx-full
    – Lucio
    Jan 15, 2013 at 20:10
  • 2
    I went through the whole thing, but no luck. So I tried removing and installing, and after a reboot everything worked ok. Could you post this as an answer so I can accept it as the right solution.
    – hstr
    Jan 15, 2013 at 23:38

3 Answers 3

22

The problem is that nginx-full depends on nginx-common, this means that you can't install the package nginx-full without have a specific version of nginx-common.

Here is an question dedicated to this problem, but the resolution is very extensive, reaching to, not only one, but different cases. So I will show you a short but effective method.

Actually, I don't know how to install that version of nginx-common, but I know that you will solve your problem by reinstalling all the package. To do that you must enter the following command in a terminal.

sudo apt-get remove nginx* && sudo apt-get install nginx-full
2
  • 3
    a reboot was required after these steps to make it all work! Thanks
    – Aakash
    Jul 21, 2015 at 15:55
  • 4
    I needed to stop Apache (also serving on port 80) before this worked. Sep 22, 2015 at 3:39
6

I had the same problem. I DO NOT have Apache, and nothing else was blocking my port 80. I could NOT install nginx with

sudo apt-get install nginx

nor with

sudo apt-get install nginx-common nginx-full

After one week I stumbled over this little blog: https://etc.banana.fish/?p=75

In this blog, the solution is:

  1. Install nginx-common: sudo apt-get install nginx-common
  2. Remove listen [::]:80 default_server; from /etc/nginx/sites-enabled/default (I made this using the root-user)
  3. Just to be sure, I did reboot my server.
  4. Just to be sure twice, I did sudo apt-get update and then sudo apt-get upgrade.
  5. Now I finally called sudo apt-get install nginx-full and it worked!

Afterwords I could see the Titlescreen of nginx, when I typed in the IP of my remote server!

0

I have a strong feeling that you forgot to run sudo apt-get update prior to running sudo apt-get upgrade - the package manager uses old information about nginx-common package version while nginx-full requires a newer version.

1
  • 1
    No, I did that.
    – hstr
    Jan 15, 2013 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.