如何在使用apt-get -f install时忽略未满足的依赖关系?

我试图用apt-get来安装imagick。 应该很简单。 这是我的命令。

apt-get install imagemagick libmagickcore-dev libmagickwand-dev 

然而,不要安装,它会一直popup这个错误信息

 The following packages have unmet dependencies: nginx-full: Depends: nginx-common (= 1.0.4-1ppa1~lucid) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

不用担心,所以我尝试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 The following NEW packages will be installed: nginx-common 0 upgraded, 1 newly installed, 0 to remove and 38 not upgraded. 2 not fully installed or removed. Need to get 0B/59.4kB of archives. After this operation, 246kB of additional disk space will be used. Do you want to continue [Y/n]? 

是的,让我们继续Y

但是,它给了我这个:

 (Reading database ... 23160 files and directories currently installed.) Unpacking nginx-common (from .../nginx-common_1.0.4-1ppa1~lucid_all.deb) ... dpkg: error processing /var/cache/apt/archives/nginx-common_1.0.4-1ppa1~lucid_all.deb (--unpack): trying to overwrite '/etc/ufw/applications.d/nginx', which is also in package nginx 0:1.0.0-0ppa1~lucid Processing triggers for man-db ... Processing triggers for ureadahead ... Errors were encountered while processing: /var/cache/apt/archives/nginx-common_1.0.4-1ppa1~lucid_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

我试过停止nginx服务。 我做了一个apt-get更新,但都无济于事:(

任何帮助将不胜感激。

这并不是通过忽略依赖来解决的,但是你的两个包似乎声称拥有文件/etc/ufw/applications.d/nginx。 如果将它移开(mv /etc/ufw/applications.d/nginx〜/ nginx-ufw-tmp),并再次尝试apt-get -f install,则不应再抱怨这个文件。 之后,您可以比较旧的和新的/etc/ufw/applications.d/nginx,并决定要保留哪一个。 请注意,这是一个特殊的情况,你似乎已经从一个PPA源安装nginx?