yum caching repository data

General support questions
Post Reply
redhavoc
Posts: 1
Joined: 2021/02/18 16:05:09

yum caching repository data

Post by redhavoc » 2021/02/18 17:27:39

Hello everyone. I have a peculiar issue with with yum and a custom repository. I have a server on CENTOS 7.7, with a few custom repositories servered through http under the /var/www/html directory. I also have a few client machines again on centos 7.7, which use those repositories during installations and for updates.

Recently I tried to update one of those repositories.Specifically I removed the open-vm-tools package version 10.3.10, and added version 11.0.5. When I update a repository, I issue the command

Code: Select all

createrepo --update .
But when I tried to update package, the client could not see any updates. Also if I removed the package and try to reinstall it, it would complain the file is not there, because it was trying to install version 10.3.10 which was deleted to be replaced by 11.0.5. This is what I got when I look for info, adding all the cache cleaning commands I am aware of

Code: Select all

# yum clean all; rm -Rf /var/lib/yum/*; rm -Rf /var/cache/yum/*; yum info open-vm-tools
Loaded plugins: fastestmirror, langpacks
Cleaning repos: CENTOS7.7-x86_64-updates CentOS-7.7 common core-0
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
CENTOS7.7-x86_64-updates                                                                 | 2.9 kB  00:00:00     
CentOS-7.7                                                                               | 2.9 kB  00:00:00     
common                                                                                   | 2.9 kB  00:00:00     
core-0                                                                                   | 3.6 kB  00:00:00     
(1/5): CENTOS7.7-x86_64-updates/primary_db                                               | 1.4 MB  00:00:00     
(2/5): core-0/group_gz                                                                   | 165 kB  00:00:00     
(3/5): CentOS-7.7/primary_db                                                             |  33 kB  00:00:00     
(4/5): common/primary_db                                                                 | 4.0 kB  00:00:00     
(5/5): core-0/primary_db                                                                 | 6.0 MB  00:00:00     
Available Packages
Name        : open-vm-tools
Arch        : x86_64
Version     : 10.3.10
Release     : 2.el7_8.1
Size        : 674 k
Repo        : CENTOS7.7-x86_64-updates
Summary     : Open Virtual Machine Tools for virtual machines hosted on VMware
URL         : https://github.com/vmware/open-vm-tools
License     : GPLv2
Description : The open-vm-tools project is an open source implementation of VMware Tools. It
            : is a suite of open source virtualization utilities and drivers to improve the
            : functionality, user experience and administration of VMware virtual machines.
            : This package contains only the core user-space programs and libraries of
            : open-vm-tools.
I tried rebooting the servers, with no change, and also to delete the repodata directory and recreate the repository from scratch using createrepo --database .. I have recreated both CentOS-7.7 and CENTOS7.7-x86_64-updates repositories because multiple packages were updated, but the example above open-vm-tools is from CENTOS7.7-x86_64-updates. None of these things made any difference, so I thought I will disable httpd on the server, and see what happens and I got the following

Code: Select all

# yum clean all; rm -Rf /var/lib/yum/*; rm -Rf /var/cache/yum/*; yum info open-vm-tools
Loaded plugins: fastestmirror, langpacks
Cleaning repos: CENTOS7.7-x86_64-updates CentOS-7.7 common core-0
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
CENTOS7.7-x86_64-updates                                                                 | 2.9 kB  00:00:00     
CentOS-7.7                                                                               | 2.9 kB  00:00:00     
common                                                                                   | 2.9 kB  00:00:00     
core-0                                                                                   | 3.6 kB  00:00:00     
(1/5): CentOS-7.7/primary_db                                                             |  33 kB  00:00:00     
(2/5): CENTOS7.7-x86_64-updates/primary_db                                               | 1.4 MB  00:00:00     
(3/5): common/primary_db                                                                 | 4.0 kB  00:00:00     
(4/5): core-0/group_gz                                                                   | 165 kB  00:00:00     
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
core-0/primary_db              FAILED                                          
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.


 One of the configured repositories failed (core-0),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=core-0 ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable core-0
        or
            subscription-manager repos --disable=core-0

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=core-0.skip_if_unavailable=true

failure: repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2 from core-0: [Errno 256] No more mirrors to try.
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
http://du1cbblr/cobbler/ks_mirror/CENTOS7.7-x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: [Errno 14] HTTP Error 503 - Service Unavailable
The curiosity here is that is seems to complain only about one of the repositories, CENTOS7.7-x86_64, while all the repositories are served by that server and nowhere else. Another curiosity is that the client seems to be downloading some metadata about those repositories, but where from?

Code: Select all

Determining fastest mirrors
CENTOS7.7-x86_64-updates                                                                 | 2.9 kB  00:00:00     
CentOS-7.7                                                                               | 2.9 kB  00:00:00     
common                                                                                   | 2.9 kB  00:00:00     
core-0                                                                                   | 3.6 kB  00:00:00     
(1/5): CentOS-7.7/primary_db                                                             |  33 kB  00:00:00     
(2/5): CENTOS7.7-x86_64-updates/primary_db                                               | 1.4 MB  00:00:00     
(3/5): common/primary_db                                                                 | 4.0 kB  00:00:00     
(4/5): core-0/group_gz                                                                   | 165 kB  00:00:00     
Finally, I checked the repodata directory of the repository CENTOS7.7-x86_64, which a repository I recreated, and the hash in the filename 04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2 is the old file name and not the one after I recreated the repository.

I also tried was reinstalling the client system, and to my surprise the repository had the old information, and if I disabled the http server, the file in repodata was again the old file!.

The final test I did, was without issuing any more createrepo commands, I renamed the directory of the repo from CENTOS7.7-x86_64-updates to CENTOS7.7-x86_64-updates_2, and also in the client change the appropriate /etc/yum.repos.d/ file to point to CENTOS7.7-x86_64-updates_2. To my surprise the repository appeared correct, and the file was reported to the correct version!!!! When I renamed back to the normal name, the old metadata appeared for the repository.

So it seems that some caching is happening on the server, given a reinstall wiped the client, and he was still seeing data that did not exist, plus the renaming of the repository. Any idea how I can identify this and fix it, given it is not practical to change repository names everyt time I make changes.

Any more information required, please let me know, and thanks in advance

User avatar
TrevorH
Forum Moderator
Posts: 30314
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum caching repository data

Post by TrevorH » 2021/02/18 20:17:36

You should start by updating to 7.9 since 7.7 is going on for 2 years out of date and will have numerous unfixed high severity security vulnerabilities.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”