在ubuntu上安装最新nginx

公众号二维码 公众号:逻魔代码

在 Ubuntu 上安装最新的nginx。

查看系统release信息和codename:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.5 LTS
Release:	12.04
Codename:	precise

执行替换过Codename后的下面的命令:

wget -q -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo sh -c 'echo deb http://nginx.org/packages/debian/ <codename> nginx > /etc/apt/sources.list.d/nginx.list'
sudo sh -c 'deb-src http://nginx.org/packages/debian/ <codename> nginx > /etc/apt/sources.list.d/nginx.list'
sudo apt-get update
sudo apt-get install nginx