repositoryyumcentos8rhel8

local repo not serving all packages on RHEL 8 type OS


I host packages locally for my servers and have done so successfully up to RHEL 8. I built custom nginx packages but when I try install them with dnf they are not found. Some packages are found though.

In this example I use Alma Linux 8.5 but the same occurred on Centos 8.5 too.

Here is my config: /etc/yum.repos.d/local.repo

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

Location to repo

[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 logs

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

Contents inside 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>

When I search with dnf I only get this package from all the others above:

# 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

I tried running createrepo with various switches like --compatibility but that makes no difference. I've disabled selinux on this test box too. I'm not checking gpg. I also split the files into noarch and x86_64 directories to no avail.

Any assistance will be appreciated. On my older servers using Centos 7 this just works.


Solution

  • The long of it is that some packages are provides in/with modules in rHEL 8+. So you need to consider that and add

    module_hotfixes=1
    

    to your local repo's config file to allow your local packages to overwrite a module.