ubuntu 换官方源 apt 安装 nginx

第一步 

添加 可信任的key:


touch  ~/nginx_signing.key
sudo vi ~/nginx_signing.key


把官方提供的 key加进去,这里是key的 url

sudo apt-key add ~/nginx_signing.key

第二步

/etc/apt/sources.list file  末尾处 添加官方源



RHEL/CentOS:

Version
5.x
6.x

Debian:

Version Codename
6.x squeeze
7.x wheezy

Ubuntu:

Version Codename
10.04 lucid
11.10 oneiric
12.04 precise
12.10 quantal
13.04 raring
我的是12 .04 所以 选择 precise
deb http://nginx.org/packages/ubuntu/ precise nginx
deb-src http://nginx.org/packages/ubuntu/ precise nginx


第3 步

apt-get update
apt-get install nginx



但是 我安装 的时候 出现了这个版本冲突错误 。 

正在解压缩 nginx (从 .../nginx_1.4.3-1~precise_i386.deb) ...
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
dpkg:处理 /var/cache/apt/archives/nginx_1.4.3-1~precise_i386.deb (--unpack)时出错:
 正试图覆盖 /usr/sbin/nginx,它同时被包含于软件包 nginx-full 1.1.19-1ubuntu0.2
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    dpkg-deb: error: subprocess 粘贴 was killed by signal (断开的管道)
在处理时有错误发生:
 /var/cache/apt/archives/nginx_1.4.3-1~precise_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

仔细一想 原来我之前 换源之前 已经安装过 1.1.19 版本的, 没卸载干净

我之前 是直接 

apt-get remove nginx  进行卸载的

还有 nginx-common 和 nginx-full 没卸载 


sudo apt-get remove  nginx-full 

sudo apt-get autoremove 

卸载干净了

开始安装

sudo apt-get install nginx 

成功

 这里是官方安装说明


转载于:https://my.oschina.net/swrite/blog/171204

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值