All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
upgrade NGinx 1.10.1 from Jessie-Backports
Hi all,
on one of my Debian 8-jessie servers, I have been running NGinx 1.9.10 from the Jessie Backports to be able to use HTTP/2. Everything runs fine but when I issue an apt-get-upgrade, it throws this error:
$ apt-get upgrade -y Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages have been kept back: mariadb-server mariadb-server-10.1 The following packages will be upgraded: nginx 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Need to get 707 kB of archives. After this operation, 2,367 kB of additional disk space will be used. Get:1 http://nginx.org/packages/debian/ jessie/nginx nginx amd64 1.10.1-1~jessie [707 kB] Fetched 707 kB in 0s (1,066 kB/s) (Reading database ... 66062 files and directories currently installed.) Preparing to unpack .../nginx_1.10.1-1~jessie_amd64.deb ... Unpacking nginx (1.10.1-1~jessie) over (1.9.10-1~bpo8+1) ... dpkg: error processing archive /var/cache/apt/archives/nginx_1.10.1-1~jessie_amd64.deb (--unpack): trying to overwrite '/usr/share/nginx/html/index.html', which is also in package nginx-common 1.9.10-1~bpo8+1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/nginx_1.10.1-1~jessie_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I dig through some forums and they suggest purging nginx nginx-common and installing again, which is NOT a good solution in my view as it will wash my config's away and I already have like 8-9 sites configured for http/2 and using Let's Encrypt SSL certificates.
Is there any other non-invasive way to upgrade to newer nginx from backports ?
Comments
You can just save/backup all your nginx config and restore after reinstall ;p
purge all nginx and use latest stable nginx - already support HTTP/2 if thats your main concern.
Try remove nginx first before reinstall the new version.
Thanks... Didn't knew that.
However
Latest Nginx in debian stable jessie is 1.6.2-5
Yes the TESTING repo shows 1.10.1
I just upgraded one of my test servers and the nginx is at 1.10.1 which makes me believe you are right.
You can try
but it will just overwrite and when you remove a package it'll corrupt other as well.
You can try only doing apt-get remove WITHOUT --purge and install the newer one.
Thanks @nomad... sounds good. Just to be safe, how should I backup the currently running nginx 1.9 so that I can restore it back incase the manual install screws up...! whole /etc/nginx is all ?? or more ?
Yeah, usually the repo installations use /etc/nginx
cp -R /etc/nginx /etc/nginx-backup will do fine I think.
But...
If you have testing repos on a working server you're just inviting trouble. I wouldn't upgrade it if I were you. Better compile it yourself and do make install instead. Then again that's not really necessary either. Is there a spesific reason to upgrade to 1,10,1?
No, not exactly any reason but I do an apt-get upgrade every 2 months, so wanted a system that upgrades fine and not leave out pkgs.
Now if the stable repos are offering http2 compliant version of nginx, I would not need backports. Still giving things a thorough try before I touch the production server
Ubuntu 16.04 come with nginx 1.9.5 by default and support http2.
Ubuntu 16.04 is at 1.10.0 right now 1.10.0-0ubuntu0.16.04.1
I must update then.
@budi1413 ... this discussion is strictly about Debian 8 only. I do not use Ubuntu.
alternatively this should work and keep your config files:
where nginx-common is the backport-packages that's in your way and remove instead of purge keeps your config... and after that again
AFAIR the nginx-packages directly from nginx are packaged in another way (no nginx-common at all) compared to those of the official debian repositories, this causes the hassle with dpkg.
(on a sidenote: probably you could try and manually delete those files which are in the way, as e.g. /usr/share/nginx/html/index.html is just the default page, but eventually there are more to come after you got rid of the first one ;-))