首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有Nginx的Centos 7服务器在更新包时报告错误

带有Nginx的Centos 7服务器在更新包时报告错误
EN

Server Fault用户
提问于 2021-12-06 20:52:38
回答 2查看 3.4K关注 0票数 5

我有一个安装了Nginx的CentOS 7虚拟机。我使用Webmin来管理服务器。

它通常会自动安装更新,但是nginx更新失败了,所以我尝试手动进行更新。它返回以下内容:

代码语言:javascript
复制
Installing package(s) with command /bin/yum -y install nginx ..
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.netsite.dk
 * epel: mirror.netsite.dk
 * extras: mirror.netsite.dk
 * updates: mirror.netsite.dk
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.20.1-9.el7 will be updated
--> Processing Dependency: nginx(abi) = 1.20.1 for package: 1:nginx-mod-mail-1.20.1-9.el7.x86_64
--> Processing Dependency: nginx(abi) = 1.20.1 for package: 1:nginx-mod-stream-1.20.1-9.el7.x86_64
--> Processing Dependency: nginx(abi) = 1.20.1 for package: 1:nginx-mod-http-perl-1.20.1-9.el7.x86_64
--> Processing Dependency: nginx(abi) = 1.20.1 for package: 1:nginx-mod-http-image-filter-1.20.1-9.el7.x86_64
--> Processing Dependency: nginx(abi) = 1.20.1 for package: 1:nginx-mod-http-xslt-filter-1.20.1-9.el7.x86_64
---> Package nginx.x86_64 1:1.20.2-1.el7.ngx will be an update
--> Finished Dependency Resolution
Error: Package: 1:nginx-mod-http-perl-1.20.1-9.el7.x86_64 (@epel)
           Requires: nginx(abi) = 1.20.1
           Removing: 1:nginx-1.20.1-9.el7.x86_64 (@epel)
               nginx(abi) = 1.20.1
           Updated By: 1:nginx-1.20.2-1.el7.ngx.x86_64 (nginx)
               Not found
Error: Package: 1:nginx-mod-stream-1.20.1-9.el7.x86_64 (@epel)
           Requires: nginx(abi) = 1.20.1
           Removing: 1:nginx-1.20.1-9.el7.x86_64 (@epel)
               nginx(abi) = 1.20.1
           Updated By: 1:nginx-1.20.2-1.el7.ngx.x86_64 (nginx)
               Not found
Error: Package: 1:nginx-mod-mail-1.20.1-9.el7.x86_64 (@epel)
           Requires: nginx(abi) = 1.20.1
           Removing: 1:nginx-1.20.1-9.el7.x86_64 (@epel)
               nginx(abi) = 1.20.1
           Updated By: 1:nginx-1.20.2-1.el7.ngx.x86_64 (nginx)
               Not found
Error: Package: 1:nginx-mod-http-image-filter-1.20.1-9.el7.x86_64 (@epel)
           Requires: nginx(abi) = 1.20.1
           Removing: 1:nginx-1.20.1-9.el7.x86_64 (@epel)
               nginx(abi) = 1.20.1
           Updated By: 1:nginx-1.20.2-1.el7.ngx.x86_64 (nginx)
               Not found
Error: Package: 1:nginx-mod-http-xslt-filter-1.20.1-9.el7.x86_64 (@epel)
           Requires: nginx(abi) = 1.20.1
           Removing: 1:nginx-1.20.1-9.el7.x86_64 (@epel)
               nginx(abi) = 1.20.1
           Updated By: 1:nginx-1.20.2-1.el7.ngx.x86_64 (nginx)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
.. install failed!

我尝试运行建议的rpm命令,然后重做包更新。但这没什么区别。

我还试着安装其他19个软件包--它们都安装正确。然后我重试了Nginx -但同样的错误还是失败了.我也试图禁用nginx回购和epel回购(万一这是两个回购之间的冲突),但它没有什么不同。

有谁知道是什么引起了这个问题,以及如何解决它?

提前感谢!

/John

EN

回答 2

Server Fault用户

回答已采纳

发布于 2021-12-17 17:33:13

我已经为我的系统解决了这个问题,尽管我的解决方案可能并不适用于每个人,这取决于您是否使用导致依赖问题的nginx-*模块。

我的解决方案是删除nginx-mod-http-perl**、** nginx-mod-stream**、** nginx-mod-mail**、** nginx-mod-http-image-filter**和** nginx-mod-http-xslt-filter,然后我就能够yum upgrade获得最新的nginx版本。

编辑以添加:除了删除这些包之外,我还更新了/etc/yum.repos.d/epel.repo以拥有exclude=nginx*,以防止@epel-provided nginx包被重新安装。

这对我有用,因为我实际上没有使用这些包提供的功能;我有一种预感,它们是由Webmin安装的(就像OP一样,我也在使用)来支持它可以提供的一些特性。

如果您正在使用这些模块提供的功能,那么我认为解决方案至少目前是禁用nginx,并在@epel发布兼容模块时重新启用它。如果这样做,您将无法获得任何nginx升级,因为在@epel上没有1.20.2可用。

核心问题似乎是您(和我)安装了nginx-1.20.1-9.el7.x86_64 (@epel),但是@epelnginx都启用了。

11月16日前后,nginx回购版发布了nginx-1.20.2,因此yum现在正试图更新到该版本。但是,对于已安装的各种1.20.2模块(无论是在@epel上还是在nginx上),没有相应的nginx-*更新,因此无法对它们进行编辑。这些模块还需要nginx(abi) = 1.20.1,这是@epel提供的模块(但nginx似乎没有提供),因此依赖项检查失败了。

Sidenote:在我们的例子中,我们确实在某个时间点安装了nginx-provided核心包,并且在某个时候用@epel版本替换了它--这是来自yum日志的:

代码语言:javascript
复制
# zgrep -h nginx.x86 /var/log/yum.log-202* /var/log/yum.log
Apr 22 03:55:37 Updated: nginx.x86_64 1:1.18.0-1.el7.ngx
Oct 30 09:27:11 Updated: nginx.x86_64 1:1.18.0-2.el7.ngx
Apr 21 08:48:33 Updated: nginx.x86_64 1:1.20.0-1.el7.ngx
May 26 04:20:28 Updated: nginx.x86_64 1:1.20.1-1.el7.ngx
Jun 18 06:46:31 Installed: nginx.x86_64 1:1.20.1-2.el7
Oct 27 04:51:03 Updated: nginx.x86_64 1:1.20.1-9.el7

6月18日,.ngx包被@epel提供的包所取代。这可能与当前的问题有关,也可能与此无关。

票数 6
EN

Server Fault用户

发布于 2022-09-25 06:39:00

代码语言:javascript
复制
yum remove nginx-mod-http-perl*
yum remove nginx-mod-stream*
yum remove nginx-mod-mail*
yum remove nginx-mod-http-image-filter*
yum remove nginx-mod-http-xslt-filter*

另外,请不要惊慌,nginx-所有模块都将被删除。

https://yum-info.contradodigital.com/view-package/epel/nginx-all-modules/

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1085573

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档