yumを介してAWS LinuxにNginx 1.16または1.17をインストールする方法は?

yumを介してAWS LinuxにNginx 1.16または1.17をインストールする方法は?

ページを引用するときhttps://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#stable_vs_mainline

次のストレージエントリを追加しました。/etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/rhel/6/$basearch/
gpgcheck=0
enabled=1

その後、インストールコマンドを実行します。yum --disablerepo=amzn-main --disablerepo=amzn-updates install nginx

このエラーが発生します

Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.17.1-1.el7.ngx will be installed
--> Processing Dependency: systemd for package: 1:nginx-1.17.1-1.el7.ngx.x86_64
--> Processing Dependency: systemd for package: 1:nginx-1.17.1-1.el7.ngx.x86_64
--> Processing Dependency: libpcre.so.1()(64bit) for package: 1:nginx-1.17.1-1.el7.ngx.x86_64
--> Finished Dependency Resolution
Error: Package: 1:nginx-1.17.1-1.el7.ngx.x86_64 (nginx)
           Requires: systemd
Error: Package: 1:nginx-1.17.1-1.el7.ngx.x86_64 (nginx)
           Requires: libpcre.so.1()(64bit)

これが最善の方法ですか、それとも別の方法を提案できる人はいますか?

ベストアンサー1

Amazon Linux 1(2018.03)を使用するのか、Amazon Linux 2を使用しているのかによって異なります。

ファイルを確認して、/etc/os-releaseどのファイルがあるかを確認してください。

AmazonLinux 1

/etc/os-release含む:

NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Amazon Linux 1用のAWSリポジトリにはnginxバージョン1.14.1のみがあります。

0» yum info nginx
Loaded plugins: priorities, update-motd, upgrade-helper
1070 packages excluded due to repository priority protections
Available Packages
Name        : nginx
Arch        : x86_64
Epoch       : 1
Version     : 1.14.1
Release     : 2.34.amzn1

Amazon Linux 2

/etc/os-release含む:

NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

この記事を書いている時点で、AL2にはnginx 1.12.2のみがあります。

» amazon-linux-extras list | grep nginx
  4  nginx1.12                available    [ =1.12.2 ]

ストックバージョンのインストール

ストックバージョンをインストールするのは簡単です。 AL1の場合を実行しyum install nginx、AL2の場合を実行しますamazon-linux-extras install nginx1.12

自分でコンパイルしてみてください

最新バージョンのnginxを実行するには、直接コンパイルするか、AWSにパッケージの更新をリクエストする必要があります。 nginxを直接コンパイルするには、Lee Bensonの素晴らしいガイドラインを参照してください。https://stackoverflow.com/questions/37082406/how-to-install-nginx-1-9-15-on-amazon-linux-disto

おすすめ記事