The Software up-to-date Option automatically download the upgrade for nginx. but While installing it's giving me the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
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:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Actually that file /etc/logrotate.d/nginx does not exist in this folder.


Run the below commands on your terminal,

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

If it's shows any dependency problem when uninstalling the above nginx-common package, then purge nginx-common package along with it's dependencies.

sudo apt-get purge nginx*

Before running the above command, don't forget to check the dependency packages which are going to be purged along with nginx.

sudo apt-get purge -s nginx*
  • post the output of sudo apt-get purge -s nginx* in your question. – Avinash Raj Mar 30 '14 at 11:10
  • i had purged the whole nginx and installed it again. actualy it helps me. – zay7sev Mar 30 '14 at 11:16
  • yes, that's what i'm trying to say. – Avinash Raj Mar 30 '14 at 11:17
  • If you get this on WSL (windows sub-system ubuntu), restart the bash with Admin rights, and it should fix it. – nick-s May 9 '18 at 2:22

protected by Community Feb 9 '15 at 18:13

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.