Ubuntu 12.04未满足的依赖关系

我有一个运行plesk的VPS,我想用一个nginx web服务器并更新php版本,但是我相信当我尝试安装nginx时,可能会和plesk发生某种冲突。

我试图在命令行中做,但出了问题,我不知道什么是错的或如何去解决它。 我不认为它允许我现在安装任何软件包?

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) 

你的系统上有一个名为sw-nginx的冲突包。 删除这个包,然后再试一次。

 sudo apt-get purge sw-nginx