1

I installed nginx 1.1.19 on my ubuntu 12.04 Server.

Now I want to upgrade it to 1.7.6, I add nginx_signing.key and apt source for nginx, then run sudo apt-get install --only-upgrade nginx. But I got this error:

The following packages were automatically installed and are no longer required:
  libjpeg8 libgd2-noxpm nginx-full libjpeg-turbo8 nginx-common
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
  nginx
1 upgraded, 0 newly installed, 0 to remove and 168 not upgraded.
Need to get 0 B/466 kB of archives.
After this operation, 904 kB of additional disk space will be used.
(Reading database ... 47117 files and directories currently installed.)
Preparing to replace nginx 1.1.19-1ubuntu0.6 (using .../nginx_1.7.6-1~precise_i386.deb) ...
Unpacking replacement nginx ...
dpkg: error processing /var/cache/apt/archives/nginx_1.7.6-1~precise_i386.deb (--unpack):
 trying to overwrite '/usr/sbin/nginx', which is also in package nginx-full 1.1.19-1ubuntu0.6
No apport report written because MaxReports is reached already
                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nginx_1.7.6-1~precise_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What's the problem and how to fix it?

3
  • You should not use the nginx upstream repository. Use the Mainline PPA, not the nginx upstream repository.
    – Thomas Ward
    Oct 9, 2014 at 21:24
  • @Parto I think this is a different issue from that other question - that other question is about mainline being newly installed, not upgrading TO mainline.
    – Thomas Ward
    Oct 9, 2014 at 21:34
  • @ThomasW. I used the Mailine PPA. In the end, I purged nginx then reinstall the new version.
    – Tony Han
    Oct 10, 2014 at 7:09

1 Answer 1

5

You are probably trying to use the nginx upstream source repositories. Unfortunately, those packages won't work if you're just trying to upgrade the packages and get the same things as Ubuntu/Debian have.

The NGINX team (or rather, myself more or less) maintains a PPA of the Mainline branch of nginx and uses the Debian package as a base for the packaging. That PPA is located here. You can add it with sudo add-apt-repository ppa:nginx/development and you should then be able to just do sudo apt-get update; sudo apt-get upgrade and it'd be upgraded to the Mainline version in the Mainline PPA.

The installation errors you're getting are because the packages in Ubuntu don't like the Upstream packages as they are not packaged the same way and have conflicted with each other in the past. By sticking to the PPAs instead of the upstream nginx.org repositories, you will not run into this upgrade failure.

1
  • Yes, I know PPAs are inherently a risk, but this PPA is entirely based on Debian and the upstream tarballs.
    – Thomas Ward
    Oct 9, 2014 at 21:28

Not the answer you're looking for? Browse other questions tagged .