dpkg-deb: 错误: 子进程paste被信号(Broken pipe)终止 nginx

软件更新选项会自动下载nginx的升级版本。但是在安装过程中,出现了以下错误:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  nginx
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/434 kB of archives.
After this operation, 977 kB of additional disk space will be used.
(Reading database ... 291344 files and directories currently installed.)
Unpacking nginx (from .../nginx_1.4.7-1~precise_amd64.deb) ...
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
dpkg: error processing /var/cache/apt/archives/nginx_1.4.7-1~precise_amd64.deb (--unpack):
 trying to overwrite '/etc/logrotate.d/nginx', which is also in package nginx-common 1.4.6-1+precise0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nginx_1.4.7-1~precise_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

实际上,这个文件 /etc/logrotate.d/nginx 在这个文件夹中并不存在。
1个回答

在终端上运行以下命令:

sudo dpkg -P nginx-common
sudo apt-get install -f

如果在卸载上述的nginx-common软件包时出现任何依赖问题,那么请同时清除nginx-common软件包及其相关依赖项。
sudo apt-get purge nginx*

在运行上述命令之前,不要忘记检查将与nginx一起删除的依赖包。
sudo apt-get purge -s nginx*

请在您的问题中发布sudo apt-get purge -s nginx*命令的输出。 - Avinash Raj
我已经彻底清除了整个Nginx并重新安装了它。实际上,这对我有所帮助。 - zay7sev
是的,那就是我想要表达的。 - Avinash Raj
1如果你在WSL(Windows子系统Ubuntu)上遇到这个问题,重新以管理员权限启动bash,应该可以解决。 - nick-s
我不得不在清除命令中添加--force depends,如这里所描述的那样。 - gitaarik