created repo is missing packages, not being served by dnf
daniejstriata opened this issue · 0 comments
I found with Centos 8 and now Alma Linux 8.5 that some packages won't be made available. I have created repos with ceaterepo on Centos 7 in the past without any issues on the same packages without needing any extra steps.
I found this post that mentioned the same issue.
https://unix.stackexchange.com/questions/584963/local-repository-on-centos-8-1-yum-is-missing-single-packages
I created an rpm from the latest 0.18.0 release and found the same issue as with the 0.17.2 version from Alma/Centos 8.5. I find it very hard to think that all these versions suffer from the same issue but I have not been able to fix this.
# rpm -qa | grep createrepo
createrepo_c-0.18.0-1.el8.x86_64
createrepo_c-libs-0.18.0-1.el8.x86_64
# uname -r
4.18.0-348.12.2.el8_5.x86_64
# cat /etc/os-release
NAME="AlmaLinux"
VERSION="8.5 (Arctic Sphynx)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.5 (Arctic Sphynx)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"
ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.5"
I do not use gpg and disabled selinux in this scenario.
- I compile nginx from src rpm and put rpm files into my repo - /opt/devops/packages
.
├── noarch
│ ├── nginx-all-modules-1.20.2-1.el8.noarch.rpm
│ └── nginx-filesystem-1.20.2-1.el8.noarch.rpm
├── repodata
│ ├── 3b07ad14fb7d28a87d7eea372f9d0b3d41aea68cdf84d5e1d6c5ef504ed8016e-other.xml.gz
│ ├── 6b7298bc7369f93f684353e58c266ccd5258f625806bd07d65a7712dac2440f7-other.sqlite.bz2
│ ├── 71a84f0ff87f2d16a38ab0e1ce52f0b42b401e5a588d8c8d875333ec0e4f94cf-primary.xml.gz
│ ├── c42025b3f7b01598c6a89f97c050de59e6e3632864d319be674cf0b64535449d-filelists.sqlite.bz2
│ ├── e4061c2dd76c52a6dd332869dc44a9f4b14d33ecabd40a2591eacbd94e0fbb71-primary.sqlite.bz2
│ ├── fa61e61c6e82f3c56a7bb3ab75f198189081a8f13c47a6b98c8e3084528a3036-filelists.xml.gz
│ └── repomd.xml
└── x86_64
├── nginx-1.20.2-1.el8.x86_64.rpm
├── nginx-debuginfo-1.20.2-1.el8.x86_64.rpm
├── nginx-debugsource-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-http-image-filter-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-http-image-filter-debuginfo-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-http-perl-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-http-perl-debuginfo-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-http-xslt-filter-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-http-xslt-filter-debuginfo-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-mail-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-mail-debuginfo-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-security-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-security-debuginfo-1.20.2-1.el8.x86_64.rpm
├── nginx-mod-stream-1.20.2-1.el8.x86_64.rpm
└── nginx-mod-stream-debuginfo-1.20.2-1.el8.x86_64.rpm
- I create the repo
createrepo_c -v /opt/devops/packages
22:02:33: Version: 0.18.0 (Features: DeltaRPM LegacyWeakdeps )
22:02:33: Signal handler setup
22:02:33: Thread pool ready
Directory walk started
22:02:33: Dir to scan: /opt/devops/packages/noarch
22:02:33: Dir to scan: /opt/devops/packages/x86_64
22:02:33: Dir to scan: /opt/devops/packages/repodata
22:02:33: Dir to scan: /opt/devops/packages/.repodata
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-http-perl-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-http-perl-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-http-xslt-filter-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-http-xslt-filter-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-mail-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-mail-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-security-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-security-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-stream-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-stream-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-debugsource-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-http-image-filter-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/x86_64/nginx-mod-http-image-filter-debuginfo-1.20.2-1.el8.x86_64.rpm
22:02:33: Adding pkg: /opt/devops/packages/noarch/nginx-all-modules-1.20.2-1.el8.noarch.rpm
22:02:33: Adding pkg: /opt/devops/packages/noarch/nginx-filesystem-1.20.2-1.el8.noarch.rpm
22:02:33: Package count: 17
Directory walk done - 17 packages
Temporary output repo path: /opt/devops/packages/.repodata/
22:02:33: Creating .xml.gz files
22:02:33: Setting number of packages
Preparing sqlite DBs
22:02:33: Creating databases
22:02:33: Thread pool user data ready
Pool started (with 5 workers)
Pool finished
22:02:33: Generating repomd.xml
22:02:33: Copying files from old repository to the new one
22:02:33: Retention type: 0 (0)
22:02:33: Excluded: 71a84f0ff87f2d16a38ab0e1ce52f0b42b401e5a588d8c8d875333ec0e4f94cf-primary.xml.gz
22:02:33: Excluded: fa61e61c6e82f3c56a7bb3ab75f198189081a8f13c47a6b98c8e3084528a3036-filelists.xml.gz
22:02:33: Excluded: 3b07ad14fb7d28a87d7eea372f9d0b3d41aea68cdf84d5e1d6c5ef504ed8016e-other.xml.gz
22:02:33: Excluded: e4061c2dd76c52a6dd332869dc44a9f4b14d33ecabd40a2591eacbd94e0fbb71-primary.sqlite.bz2
22:02:33: Excluded: c42025b3f7b01598c6a89f97c050de59e6e3632864d319be674cf0b64535449d-filelists.sqlite.bz2
22:02:33: Excluded: 6b7298bc7369f93f684353e58c266ccd5258f625806bd07d65a7712dac2440f7-other.sqlite.bz2
22:02:33: Excluded: repomd.xml
22:02:33: Renamed /opt/devops/packages/repodata/ -> /opt/devops/packages/repodata.old.22639.20220222220233.682333
22:02:33: Renamed /opt/devops/packages/.repodata/ -> /opt/devops/packages/repodata/
22:02:33: Old repo /opt/devops/packages/repodata.old.22639.20220222220233.682333 removed
22:02:33: Memory cleanup
22:02:33: All done
I now have this structure
drwxr-xr-x. 2 root root 103 Feb 22 14:34 noarch
drwxr-xr-x. 2 root root 4096 Feb 22 22:19 repodata
drwxr-xr-x. 2 root root 4096 Feb 22 21:53 x86_64
my repo files looks like this:
[LocalRepo]
name=LocalRepo
metadata_expire=-1
enabled=1
gpgcheck=0
baseurl=file:///opt/devops/packages/
but after updating my local cache I only see some of the packages from my local repo.
# dnf update --refresh
# dnf repository-packages LocalRepo list
Last metadata expiration check: 0:00:06 ago on Tue 22 Feb 2022 22:08:51 SAST.
Available Packages
nginx-mod-security.x86_64 1:1.20.2-1.el8 LocalRepo
nginx-mod-security-debuginfo.x86_64 1:1.20.2-1.el8 LocalRepo
when I check the primary.xml
file I see that all the rpm files were added.
# zgrep "<name>" 71a84f0ff87f2d16a38ab0e1ce52f0b42b401e5a588d8c8d875333ec0e4f94cf-primary.xml.gz
<name>nginx</name>
<name>nginx-all-modules</name>
<name>nginx-debuginfo</name>
<name>nginx-debugsource</name>
<name>nginx-filesystem</name>
<name>nginx-mod-http-image-filter</name>
<name>nginx-mod-http-image-filter-debuginfo</name>
<name>nginx-mod-http-perl</name>
<name>nginx-mod-http-perl-debuginfo</name>
<name>nginx-mod-http-xslt-filter</name>
<name>nginx-mod-http-xslt-filter-debuginfo</name>
<name>nginx-mod-mail</name>
<name>nginx-mod-mail-debuginfo</name>
<name>nginx-mod-security</name>
<name>nginx-mod-security-debuginfo</name>
<name>nginx-mod-stream</name>
<name>nginx-mod-stream-debuginfo</name>