我无法从官方存储库安装 nginx 1.22.1

我无法从官方存储库安装 nginx 1.22.1

我在 Oracle Linux 8.8 上有一个虚拟机,我需要安装 nginx-1.22.1,但只能从官方存储库安装版本 nginx-1.14.1:

https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/index.html

此版本 nginx-1.22.1 存在于此存储库中。此存储库还已启用:

[ol8_appstream]
name=Oracle Linux 8 Application Stream ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/appstream/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

我已经执行了以下命令:

yum clean all
yum makecache

但执行后:

yum install nginx

yum管理器只能安装1.14.1版本:

nginx     x86_64     1:1.14.1-9.0.1.module+el8.0.0+5347+9282027e

你能帮助我吗?

答案1

  1. 要检查可用的模块版本:
# dnf module list | grep -i nginx
nginx                1.14 [d][e]     common [d]                               nginx webserver
nginx                1.16            common [d]                               nginx webserver
nginx                1.18            common [d]                               nginx webserver
nginx                1.20            common [d]                               nginx webserver
nginx                1.22            common [d]                               nginx webserver

提示:[d]default, [e]nabled, [x]disabled, [i]nstalled

  1. 如果已启用,请重置模块:

# dnf module reset nginx

  1. 要启用所需版本的模块:

# dnf module enable nginx:1.22

  1. 要使用所需版本更新模块包:

# dnf update nginx

  1. 要安装所需版本的模块包:

# dnf install nginx

答案2

Oracle 认为这个版本对于生产来说足够稳定,这就是他们不提供下一个版本并且不更新 repo 索引文件的原因。但您始终可以从 nginx.org repo 安装。以下是 RPM 文件的路径:https://nginx.org/packages/rhel/8/x86_64/RPMS/

您可以通过命令安装它:

yum localinstall https://nginx.org/packages/rhel/8/x86_64/RPMS/nginx-1.22.1-1.el8.ngx.x86_64.rpm

或者您可以尝试直接从 Oracle repo 安装:

yum localinstall https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/nginx-1.22.1-1.0.1.module+el8.8.0+21016+51077804.x86_64.rpm

相关内容