Ubuntu 12.04 unmet dependencies

Matt asked:

I have a VPS which is running plesk, I wanted to use a nginx web server and update the php version but I believe there could’ve been some sort of conflict with plesk when I tried to install nginx.

I tried doing it in command line, but something has gone wrong and I have no idea what’s wrong or how to go about fixing it. I don’t think it allows me to install any packages now?

root@:~# sudo add-apt-repository ppa:ondrej/php5-oldstable

sudo: add-apt-repository: command not found

root@:~# sudo apt-get install python-software-properties

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 : Depends: nginx-full but it is not going to be installed or
                  nginx-light but it is not going to be installed
 python-software-properties : Depends: python-apt (>= 0.6.20ubuntu16) but it is not going to be installed
                              Depends: python-gnupginterface but it is not going to be installed
                              Depends: unattended-upgrades but it is not going to be installed
                              Depends: python-pycurl but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

root@:~# 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-common nginx-full
The following NEW packages will be installed:
  nginx-common nginx-full
0 upgraded, 2 newly installed, 0 to remove and 238 not upgraded.
1 not fully installed or removed.
Need to get 0 B/395 kB of archives.
After this operation, 1141 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 75011 files and directories currently installed.)
Unpacking nginx-common (from .../nginx-common_1.1.19-1ubuntu0.7_all.deb) ...
dpkg: error processing /var/cache/apt/archives/nginx-common_1.1.19-1ubuntu0.7_all.deb (--unpack):
 trying to overwrite '/usr/share/man/man1/nginx.1.gz', which is also in package sw-nginx 1.5.0-1.13060711.ubuntu1204
Unpacking nginx-full (from .../nginx-full_1.1.19-1ubuntu0.7_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/nginx-full_1.1.19-1ubuntu0.7_amd64.deb (--unpack):
 trying to overwrite '/usr/sbin/nginx', which is also in package sw-nginx 1.5.0-1.13060711.ubuntu1204
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/nginx-common_1.1.19-1ubuntu0.7_all.deb
 /var/cache/apt/archives/nginx-full_1.1.19-1ubuntu0.7_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

My answer:


You have a conflicting package on your system, named sw-nginx. Remove this package and then try again.

sudo apt-get purge sw-nginx

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.