Report this

What is the reason for this report?

Update nginx to version 1.9.5

Posted on October 8, 2015

Hi,

i added the nginx repo to my source.list deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx

After this i did a sudo apt-get update and a sudo apt-get clean && sudo apt-get install nginx

but i get the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-61 linux-headers-3.13.0-61-generic
  linux-headers-3.13.0-62 linux-headers-3.13.0-62-generic
  linux-headers-3.13.0-63 linux-headers-3.13.0-63-generic
  linux-image-3.13.0-61-generic linux-image-3.13.0-62-generic
  linux-image-3.13.0-63-generic linux-image-extra-3.13.0-61-generic
  linux-image-extra-3.13.0-62-generic linux-image-extra-3.13.0-63-generic
  nginx-common nginx-full
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
  nginx
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/426 kB of archives.
After this operation, 1093 kB of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "de_DE.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 191862 files and directories currently installed.)
Preparing to unpack .../nginx_1.9.5-1~trusty_amd64.deb ...
Unpacking nginx (1.9.5-1~trusty) over (1.8.0-1+trusty1) ...
dpkg: error processing archive /var/cache/apt/archives/nginx_1.9.5-1~trusty_amd64.deb (--unpack):
 trying to overwrite '/usr/share/nginx/html/index.html', which is also in package nginx-common 1.8.0-1+trusty1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nginx_1.9.5-1~trusty_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
forge@hostianer:~$ sudo nano /etc/apt/sources.list

My current nginx version is nginx/1.8.0

How can i solve this problem and update to the latest http2 nginx version?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

The issue is with the apt-get clean command being issued after apt-get update and before apt-get install nginx. What is happening is you are updating your package cache then clearing it out again before you install NGINX.

This should work below.

sudo apt-get update && sudo apt-get install -y nginx 

You can build nginx from source

first get your language settings right, this should work:

sudo nano /etc/default/locale

add this line at the bottom:

LC_ALL="en_US.UTF-8"

(or use “de_DE” if you prefer this) then reboot and repeat your installation procedure

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.