本地仓库不提供 RHEL 8 类型 OS 上的所有软件包

local repo not serving all packages on RHEL 8 type OS

我在本地为我的服务器托管软件包,并成功地做到了 RHEL 8。我构建了自定义 nginx 软件包,但是当我尝试使用 dnf 安装它们时,找不到它们。虽然找到了一些包。

在此示例中,我使用 Alma Linux 8.5,但同样的情况也发生在 Centos 8.5 上。

这是我的配置: /etc/yum.repos.d/local.repo

[local_el]
name=local_el
metadata_expire=-1
enabled=1
gpgcheck=0
baseurl=file:///opt/devops/packages/

回购位置

[root@alma8 packages]# ll
total 1112
-rw-r--r--. 1 root root 897716 Feb 22 13:28 nginx-1.20.2-1.el8.x86_64.rpm
-rw-r--r--. 1 root root  25476 Feb 22 13:28 nginx-all-modules-1.20.2-1.el8.noarch.rpm
-rw-r--r--. 1 root root  26616 Feb 22 13:28 nginx-filesystem-1.20.2-1.el8.noarch.rpm
-rw-r--r--. 1 root root  37216 Feb 22 13:29 nginx-mod-http-image-filter-1.20.2-1.el8.x86_64.rpm
-rw-r--r--. 1 root root  36628 Feb 22 13:29 nginx-mod-security-1.20.2-1.el8.x86_64.rpm
-rw-r--r--. 1 root root  95312 Feb 22 13:29 nginx-mod-stream-1.20.2-1.el8.x86_64.rpm
drwxr-xr-x. 2 root root   4096 Feb 22 14:15 repodata

Createrepo 日志

14:45:03: Version: 0.17.2 (Features: DeltaRPM LegacyWeakdeps )
14:45:03: Signal handler setup
14:45:03: Thread pool ready
Directory walk started
14:45:03: Dir to scan: packages/noarch
14:45:03: Dir to scan: packages/x86_64
14:45:03: Dir to scan: packages/repodata
14:45:03: Dir to scan: packages/.repodata
14:45:03: Adding pkg: packages/x86_64/nginx-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-http-image-filter-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-http-perl-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-http-xslt-filter-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-mail-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-stream-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-security-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-debugsource-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-http-image-filter-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-http-perl-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-http-xslt-filter-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-mail-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-stream-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/x86_64/nginx-mod-security-debuginfo-1.20.2-1.el8.x86_64.rpm
14:45:03: Adding pkg: packages/noarch/nginx-all-modules-1.20.2-1.el8.noarch.rpm
14:45:03: Adding pkg: packages/noarch/nginx-filesystem-1.20.2-1.el8.noarch.rpm
14:45:03: Package count: 17
Directory walk done - 17 packages
Temporary output repo path: packages/.repodata/
14:45:03: Creating .xml.gz files
14:45:03: Setting number of packages
Preparing sqlite DBs
14:45:03: Creating databases
14:45:03: Thread pool user data ready
Pool started (with 5 workers)
Pool finished
14:45:03: Generating repomd.xml
14:45:03: Copying files from old repository to the new one
14:45:03: Retention type: 0 (0)
14:45:03: Excluded: 71a84f0ff87f2d16a38ab0e1ce52f0b42b401e5a588d8c8d875333ec0e4f94cf-primary.xml.gz
14:45:03: Excluded: fa61e61c6e82f3c56a7bb3ab75f198189081a8f13c47a6b98c8e3084528a3036-filelists.xml.gz
14:45:03: Excluded: 3b07ad14fb7d28a87d7eea372f9d0b3d41aea68cdf84d5e1d6c5ef504ed8016e-other.xml.gz
14:45:03: Excluded: e4061c2dd76c52a6dd332869dc44a9f4b14d33ecabd40a2591eacbd94e0fbb71-primary.sqlite.bz2
14:45:03: Excluded: c42025b3f7b01598c6a89f97c050de59e6e3632864d319be674cf0b64535449d-filelists.sqlite.bz2
14:45:03: Excluded: 6b7298bc7369f93f684353e58c266ccd5258f625806bd07d65a7712dac2440f7-other.sqlite.bz2
14:45:03: Excluded: repomd.xml
14:45:03: Renamed packages/repodata/ -> packages/repodata.old.10421.20220222144503.378656
14:45:03: Renamed packages/.repodata/ -> packages/repodata/
14:45:03: Old repo packages/repodata.old.10421.20220222144503.378656 removed
14:45:03: Memory cleanup
14:45:03: All done

里面的内容primary.xml

zgrep "<name>" 22ccd45fe12baca6053f1feb1586a7e5a62956ca05587c49c44596fa75e8da7c-primary.xml.gz
  <name>nginx</name>
  <name>nginx-all-modules</name>
  <name>nginx-filesystem</name>
  <name>nginx-mod-http-image-filter</name>
  <name>nginx-mod-security</name>
  <name>nginx-mod-stream</name>

当我用 dnf 搜索时,我只从上面的所有其他包中得到这个包:

# dnf repository-packages Doxim_el list
Last metadata expiration check: 0:03:09 ago on Tue 22 Feb 2022 14:39:28 SAST.
Available Packages
nginx-mod-security.x86_64                                                                  1:1.20.2-1.el8                                                        local_el
nginx-mod-security-debuginfo.x86_64                                                        1:1.20.2-1.el8                                                        local_el

我尝试 运行 createrepo 使用各种开关,如 --compatibility 但这没有什么区别。我也在这个测试盒上禁用了 selinux。我没有检查 gpg。 我也将文件拆分为 noarchx86_64 目录,但无济于事。

如有任何帮助,我们将不胜感激。在我使用 Centos 7 的旧服务器上,这很有效。

最重要的是,某些软件包在 rHEL 8+ 中提供了 in/with 模块。所以你需要考虑这一点并添加

module_hotfixes=1

到您本地存储库的配置文件,以允许您的本地包覆盖模块。