6

Ubuntu installs nginx 1.4.6 as default. I'm trying to install the lastest stable version of nginx (1.6.2). So here it says:

you need to add Ubuntu PPA repository to get latest stable version of Nginx on your system. use the below commands to do it.

# Add repository to your system
# magesh@magesh-desktop:~$ add-apt-repository ppa:nginx/$nginx

But when I try this command it throws error:

Cannot add PPA: 'ppa:nginx/'.
Please check that the PPA name or format is correct.

How can I solve it?

Thanks

12

Replace $nginx with stable :

add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx
  • @Alex Jolig, When i was adding PPA they build the repository like that. Updated the article as per Xavier Lucas advice. Thanks for notifying the error. – Magesh M Feb 9 '15 at 5:04
  • This worked for me to be able to add http2 to my nginx vhost config on Ubuntu 14.04. Thanks – jamescampbell Oct 2 '17 at 3:58
0

In the dir /etc/apt/sources.list.d/ make file nginx.list with these lines:

deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx

Here codename is your Ubuntu version (Lucyd Lync, Hardy Heron, etc).

Also you must add PGP key in your store and update packages list:

http://nginx.org/keys/nginx_signing.key
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signinx.key
apt-get update

Now you can install latest stable version of nginx. All information from nginx.org.

  • Did that before asking the question. But didn't work – Alex Jolig Feb 9 '15 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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