无法通过 APT 安装包

无法通过 APT 安装包

在尝试安装该软件包时,sw-nginx我遇到了以下错误消息:

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/327 kB of archives.
After this operation, 813 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
sw-nginx
Authentication warning overridden.
(Reading database ... 149469 files and directories currently installed.)
Unpacking sw-nginx (from .../sw-nginx_1.6.0-1.14051516.debian70_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/sw-nginx_1.6.0-1.14051516.debian70_amd64.deb (--unpack):
trying to overwrite '/etc/logrotate.d/nginx', which is also in package nginx 1.6.2-1~wheezy
dpkg-deb (subprocess): decompressing archive member: internal gzip write error: Broken pipe
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/sw-nginx_1.6.0-1.14051516.debian70_amd64.deb' to decompressor pipe: failed to write (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/sw-nginx_1.6.0-1.14051516.debian70_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Error: An error occurred on attempt to install packages.
Attention! Your software might be inoperable.
Please, contact product technical support.

我怎样才能安装这个包?

答案1

我想出了如何通过像这样进行安装来解决我的问题:

$ sudo dpkg -i --force-overwrite packagename

看来我从另一个nginx包中遇到了冲突,该包与这个新包有共同的文件。我选择了严厉的方法并简单地执行了上述操作--force-overwrite

不要使用:)它没用,它会在另一个地方破坏它......

相关内容