【问题标题】:How to upgrade nginx from 1.16 to 1.18 on centos7centos7上如何将nginx从1.16升级到1.18
【发布时间】:2021-01-25 03:05:32
【问题描述】:

我想将我的 nginx 从 1.16 版本升级到 1.18。

以下是之前关于nginx的情况。

[root@localhost ~]# rpm -qa | grep nginx
nginx-mod-mail-1.16.1-1.el7.x86_64
nginx-1.16.1-1.el7.x86_64
nginx-filesystem-1.16.1-1.el7.noarch
nginx-mod-http-image-filter-1.16.1-1.el7.x86_64
nginx-mod-http-xslt-filter-1.16.1-1.el7.x86_64
nginx-mod-http-perl-1.16.1-1.el7.x86_64
nginx-mod-stream-1.16.1-1.el7.x86_64
nginx-all-modules-1.16.1-1.el7.noarch

然后我删除了 nginx 1.16 版本,并在注册 nginx yum 存储库后尝试安装 1.18 版本。我发现 nginx 1.18 不需要依赖的 rpm

Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.18.0-2.el7.ngx will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                    Arch                        Version                                   Repository                  Size
===================================================================================================================================
Installing:
 nginx                      x86_64                      1:1.18.0-2.el7.ngx                        nginx                      769 k

Transaction Summary
===================================================================================================================================
Install  1 Package

Total download size: 769 k
Installed size: 2.7 M
Is this ok [y/d/N]:

nginx 1.18 不需要安装rpms以下吗?如果是这样,nginx 1.18 是否需要任何其他额外的 rpm?

nginx-mod-mail-1.16.1-1.el7.x86_64
nginx-1.16.1-1.el7.x86_64
nginx-filesystem-1.16.1-1.el7.noarch
nginx-mod-http-image-filter-1.16.1-1.el7.x86_64
nginx-mod-http-xslt-filter-1.16.1-1.el7.x86_64
nginx-mod-http-perl-1.16.1-1.el7.x86_64
nginx-mod-stream-1.16.1-1.el7.x86_64
nginx-all-modules-1.16.1-1.el7.noarch

【问题讨论】:

    标签: nginx centos7


    【解决方案1】:

    哟, 首先你需要从centos7中删除nginx:-

    https://otodiginet.com/software/how-to-unistall-nginx-from-centos-7/

    然后在你的服务器上下载 nginx 1.18 :-

    https://centos.pkgs.org/7/getpagespeed-x86_64/nginx-1.18.0-1.el7.ngx.x86_64.rpm.html

    安装步骤

    1. 安装 GetPageSpeed 存储库:

      yum install https://extras.getpagespeed.com/release-el7-latest.rpm

    2. 安装 nginx rpm 包:

      yum 安装 nginx

    【讨论】:

      【解决方案2】:

      当从 EPEL 打包的 NGINX 构建切换到 nginx.org(或 getpagespeed.com)构建时,安装更新的 NGINX 后,您需要运行:

      yum remove $(yum list installed | grep 'nginx.*@epel' | awk '{ print $1 }')
      

      这将删除任何无关的包,如nginx-mod-stream。不需要它们,因为它们的文件和功能已经包含在主包 nginx 中。

      【讨论】:

      • 哦,所以这些包已经包含在主 nginx 1.18 rpm 中。谢谢!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-13
      • 1970-01-01
      • 2019-03-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多