自定义 rpm 依赖于特定版本的 nginx

custom rpm dependency to a specific version of nginx

我正在尝试为特定的 nginx 模块创建 RPM。我的 spec 文件构建了模块并成功创建了包,但我不能使它取决于构建我的模块的 nginx 包的权利。

在我的规范文件中,我尝试使用:

Requires: nginx == 1.12.2-1.el7_4.ngx

Ben 然后当我尝试安装我的模块时,yum 失败并显示以下消息:

Error: Package: 1:nginx-headers-more-1.12.2-0.33-2.el7_4.x86_64 (custom)
       Requires: nginx = 1.12.2-1.el7_4.ngx
       Available: 1:nginx-1.8.0-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.8.0-1.el7.ngx
       Available: 1:nginx-1.8.1-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.8.1-1.el7.ngx
       Available: 1:nginx-1.10.0-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.10.0-1.el7.ngx
       Available: 1:nginx-1.10.1-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.10.1-1.el7.ngx
       Available: 1:nginx-1.10.2-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.10.2-1.el7.ngx
       Available: 1:nginx-1.10.3-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.10.3-1.el7.ngx
       Available: 1:nginx-1.12.0-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.12.0-1.el7.ngx
       Available: 1:nginx-1.12.1-1.el7.ngx.x86_64 (nginx)
           nginx = 1:1.12.1-1.el7.ngx
       Installing: 1:nginx-1.12.2-1.el7_4.ngx.x86_64 (nginx)
           nginx = 1:1.12.2-1.el7_4.ngx
       Available: 1:nginx-1.14.0-1.el7_4.ngx.x86_64 (nginx)
           nginx = 1:1.14.0-1.el7_4.ngx
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我哪里错了?

为了子孙后代,

问题是 nginx 版本他的包有 epoch see rpm doc here(即 1: 开头的 1: 1:1.12.2-1.el7_4.ngx)

如此改变:

Requires: nginx == 1.12.2-1.el7_4.ngx

至:

Requires: nginx == 1:1.12.2-1.el7_4.ngx

解决了我的问题。