YUM not listing rpms from my local hosted repository

General support questions
Post Reply
lintek28
Posts: 10
Joined: 2016/05/06 15:07:27

YUM not listing rpms from my local hosted repository

Post by lintek28 » 2018/08/26 13:58:17

I setup a Nexus Yum Repository within my local network. I'm able to push and pull rpms from the repo with the curl and wget commands. I then configured a repo file in /etc/yum.repo.d called nexus.repo. But yum will not list the rpms that I pushed into the yum host. The metadata on the host is being updated. Is this a yum client issue?

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

Re: YUM not listing rpms from my local hosted repository

Post by TrevorH » 2018/08/26 15:23:46

Possibly. Yum has a metadata_expire= parameter that defaults to something like 6 hours (in seconds) and will not try to refresh metadata from the repo if its current copy is younger than that time interval. You can adjust that globally for all repos in /etc/yum.conf or per repo by adding it to the .repo file in /etc/yum.repos.d/
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

lintek28
Posts: 10
Joined: 2016/05/06 15:07:27

Re: YUM not listing rpms from my local hosted repository

Post by lintek28 » 2018/08/29 00:52:04

I used the yum.conf parameter and it did help. (Thanks) In addition to that, I made another discovery that might explain what I thought was a problem but not. I think I need a better understanding of how yum works from the yum repo to the client. To start, my repo contained four testing rpms named like this:

mytestrpmclient-1.0.0-R1.el7.x86_64.rpm
mytestrpmserver-1.0.0-R1.el7.x86_64.rpm
mytestrpmlatop-1.0.0-R1.el7.x86_64.rpm
mytestrpmworkstation-1.0.0-R1.el7.x86_64.rpm

I sent updates to the repo changing the release value to "R2.el7". But when I run # yum list the output stayed as:

mytestrpmclient.x86_64 1.0.0-R1.el7 myrepo
mytestrpmserver.x86_64 1.0.0-R1.el7 myrepo
mytestrpmlatop.x86_64 1.0.0-R1.el7 myrepo
mytestrpmworkstation.x86_64 1.0.0-R1.el7 myrepo

I expected to see the rpm names above but with "1.0.0-R2.el7".
The repo host contains all the rpms.

mytestrpmclient-1.0.0-R1.el7.x86_64.rpm
mytestrpmserver-1.0.0-R1.el7.x86_64.rpm
mytestrpmlatop-1.0.0-R1.el7.x86_64.rpm
mytestrpmworkstation-1.0.0-R1.el7.x86_64.rpm
mytestrpmclient-1.0.0-R2.el7.x86_64.rpm
mytestrpmserver-1.0.0-R2.el7.x86_64.rpm
mytestrpmlatop-1.0.0-R2.el7.x86_64.rpm
mytestrpmworkstation-1.0.0-R2.el7.x86_64.rpm

How can I get yum to just display the "1.0.0-R2.el7" versions when I run yum list without having to remove the "1.0.0-R1.el7" version first? For the result to be as:

mytestrpmclient.x86_64 1.0.0-R2.el7 myrepo
mytestrpmserver.x86_64 1.0.0-R2.el7 myrepo
mytestrpmlatop.x86_64 1.0.0-R2.el7 myrepo
mytestrpmworkstation.x86_64 1.0.0-R2.el7 myrepo

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

Re: YUM not listing rpms from my local hosted repository

Post by TrevorH » 2018/08/29 09:26:14

Did you rerun createrepo after adding the new packages? Did you run yum clean all on the client to force it to refresh the repo metadata?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

lintek28
Posts: 10
Joined: 2016/05/06 15:07:27

Re: YUM not listing rpms from my local hosted repository

Post by lintek28 » 2018/08/29 15:21:25

I did not run createrepo. The repo exist through Nexus Repo manager OSS. However, what did resolve the "latest" display of rpm revisions issue was running 'yum clean expire-cache'. Which I still can't figure out why I had to run because I did add 'metadata_expire=1m' in the yum.conf file. I shouldn't need a cronjob to run 'yum clean expire-cache' to keep my repo cache in sync with the metadata on the Nexus host. but I can't think of anything else to do at this point.

This is what yum repoinfo is showing me.

[root]# yum repoinfo
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Repo-id : nexus3/7/x86_64
Repo-name : NexusNG - Base
Repo-revision: 1535548500
Repo-updated : Wed Aug 29 09:15:00 2018
Repo-pkgs : 12
Repo-size : 41 k
Repo-baseurl : http://xxxxxxxx:8081/repository/que-rel ... /packages/
Repo-expire : 60 second(s) (last: Wed Aug 29 09:30:07 2018)
Filter : read-only:present
Repo-filename: /etc/yum.repos.d/NexusNG.repo

The repo host was updated twice after "Repo-updated : Wed Aug 29 09:15:00 2018". The time stamp is old and the rpms have been updated. As mentioned above, if I were to run 'yum clean expire-cache', that time stamp would change and my rpms updates will show up with 'yum list'.

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

Re: YUM not listing rpms from my local hosted repository

Post by TrevorH » 2018/08/29 15:45:11

Something has to run createrepo after adding packages to a repo or they will not be listed in the metatdata so won't be available to the client.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

lintek28
Posts: 10
Joined: 2016/05/06 15:07:27

Re: YUM not listing rpms from my local hosted repository

Post by lintek28 » 2018/08/29 16:05:28

Yes there is but it's on the Nexus server side since its a hosted repo and not a local repo. There is a scheduled task which is set to rebuild the repo metadata each hour. I can see the metadata files updating but the client does not as evident in the output from the yum repoinfo command.

lintek28
Posts: 10
Joined: 2016/05/06 15:07:27

Re: YUM not listing rpms from my local hosted repository

Post by lintek28 » 2018/08/31 11:05:56

I found the nexus log that display the info of what happens when the task is executed. Its running creatrepo.

2018-08-31 05:15:00,068-0400 INFO [event-9-thread-1637] *SYSTEM org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl - Finished rebuildin
g yum metadata for repository que-release

Post Reply