1

Running Ubuntu 11.04 with nginx 0.8.4 how do I upgrade to stable (1.2.0) without screwing my whole setup (multiple sites + varnish + php-fpm + memcache)?

3 Answers 3

4

I searched a little & found out that the natty version is 0.8.4 and cannot be updated to 1.2.0 by Robert Arkenin's command
To upgrade you should consider adding the ppa by the following commands

sudo -s  
nginx=stable # use nginx=development for latest development version  
add-apt-repository ppa:nginx/$nginx  
apt-get update   
apt-get install nginx  

If you get an error about add-apt-repository not existing, you can try this

sudo -s    
nginx=stable # use nginx=development for latest development version  
echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu natty main" > /etc/apt/sources.list.d/nginx-$nginx-lucid.list  
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C  
apt-get update   
apt-get install nginx  

Note The 3rd and 4th line is one command only
For more details refer Nignx wiki


If you are getting this error

W: Failed to fetch ppa.launchpad.net/nginx//ubuntu/dists/lucid/main/binary-i386/… 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead

Do this
sudo nano '/etc/apt/sources.list.d/nginx-stable-lucid.list'
And then change the contents of the file to
deb http://ppa.launchpad.net/nginx/stable/ubuntu natty main


Something to learn

Actually if you see in the error this part "ppa.launchpad.net/nginx//ubuntu/dists/" should actually be "ppa.launchpad.net/nginx/stable/ubuntu/dists/" . that is the error
and sorry for making you add the lucid ppa the first tme.

6
  • Thanks for the help. but I am getting this error: W: Failed to fetch ppa.launchpad.net/nginx//ubuntu/dists/lucid/main/binary-i386/… 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.
    – bran
    May 18, 2012 at 18:55
  • @Ashu Got it; sorry for bad information--I'll be more careful next time
    – nanofarad
    May 18, 2012 at 20:02
  • @bran did you use the first method or second
    – Ashu
    May 19, 2012 at 4:42
  • @bran edited my answer... corrected errors.
    – Ashu
    May 19, 2012 at 6:14
  • @Ashu still getting the same error. Even after following your updated instructions. Says "nginx is already the newest version.". nginx -v says 0.8.4
    – bran
    May 20, 2012 at 18:19
1

here's a guide to upgrading / installing to the latest stable or latest development version of nginx without having to compile from sources: http://usefulmix.com/install-upgrade-to-latest-nginx-without-compiling-from-source/

1
  • Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Peachy
    Nov 20, 2012 at 22:09
1
$sudo apt-key add nginx_signing.key # content of key file is in the guide link

Add official nginx source to the sources list by appending the following to the end of /etc/apt/sources.list

deb http://nginx.org/packages/ubuntu/ codename nginx  #codename is lucid in ubuntu 10.10 
deb-src http://nginx.org/packages/ubuntu/ codename nginx

Then run the following commands:

$sudo apt-get update
$sudo install nginx

I update the nginx from 0.7 to 1.7 in ubuntu 10.10 by following the guide. Hope this will help others.

2
  • Link only answers are usually not wanted. It's better to summarize the content of the link in your answer. So it's easier to see what the link is about and your answer doesn't become worthless in case the link breaks.
    – Minos
    Oct 13, 2014 at 10:32
  • @Minos Thanks for your kindly suggestion. Now i have added a brief summary.
    – Chancy
    Oct 13, 2014 at 15:44

You must log in to answer this question.

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