在 Debian 9 上安装 Nginx

在 Debian 9 上安装 Nginx

情况是这样的,我试图在我几乎纯 Debian 9 的服务器上安装 Nginx。基本上我尝试了
sudo apt-get install nginx
,下面是输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nginx : Depends: nginx-extras (>= 1:1.12.1-8.5.1.8~jessie1) but it is not going to be installed
         Depends: nginx-extras (< 1:1.12.1-8.5.1.8~jessie1.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.  

输入:

/etc/apt/source.list  

输出:

deb http://cdn-aws.deb.debian.org/debian stretch main
deb http://security.debian.org stretch/updates main
deb http://cdn-aws.deb.debian.org/debian stretch-updates main

输入:

apt-cache policy nginx

输出:

nginx:
Installed: (none)
Candidate: 1:1.12.1-8.5.1.8~jessie1
  Version table:
 1:1.12.1-8.5.1.8~jessie1 500
    500 https://oss-binaries.phusionpassenger.com/apt/passenger jessie/main amd64 Packages
         .
         .
         .
 1:1.6.3-8.5.0.8~jessie1 500
    500 https://oss-binaries.phusionpassenger.com/apt/passenger jessie/main amd64 Packages
 1.10.3-1+deb9u1 500
    500 http://cdn-aws.deb.debian.org/debian stretch/main amd64 Packages
    500 http://security.debian.org stretch/updates/main amd64 Packages

输入:

cat /etc/apt/sources.list.d/*

输出:

deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main
deb https://oss-binaries.phusionpassenger.com/apt/passenger stretch main

答案1

我在 stackoverflow 上发现了针对 Ubuntu 14.04 的相同问题,我对其进行了一些修改,然后就好了!

sudo nano /etc/apt/sources.list.d/passenger.list

并注释掉。

deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main

在那之后

sudo apt-get update
sudo apt-get install nginx nginx-extras

对我的情况来说没问题。再次取消注释

deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main

我已准备好出发了。

相关内容