I made a local CentOS 7 repository (here) with custom packages built and it is working fine, the problem is in yum update. When I update the source of an RPM package, I either increase the epoch or the version number so yum detects its an update, I copy the new RPM package to the repo directory and on a client PC I do yum install or yum update to install/update the package and yum returns with error "No more mirrors to try" or something like that. The only way to make it work again is to recreate the local repo from scratch. So the question is, how do I properly update an RPM package in a CentOS 7 repo?

P.S: If I add a new package and do a createrepo -v it will tell me No package available.


The good way to maintain local repo is to establish kind of replication process (rsync, wget) from the original site and then update the information in repo. The command to update is:

createrepo --update

To avoid cd to the repo directory you can use command on this way:

createrepo --update /path/to/repo/directory

EDIT: Also you can check if the yum cache file is corrupted (/var/cache/yum). Usually clean it/delete can help. You can check here for reference.

| improve this answer | |
  • What about a local repo that contains packages I made? – 3bdalla Jun 24 '19 at 7:34
  • @3bdalla, its the same. Just be careful when using rsync (it can delete files which are missing i.e. your packages). You can create second repo and keep packages there. – Romeo Ninov Jun 24 '19 at 7:39
  • Actually I got the same error when I updated a package, incrementing epoch first then the version. I recreated the repo, installed the package first, then copied the new RPM to the repo location and did createrepo --update but I got No packages marked for update – 3bdalla Jun 25 '19 at 12:19
  • Did you try to use command on this way: createrepo --update /path/to/repo/directory? – Romeo Ninov Jun 25 '19 at 13:47
  • 1
    I got it. The problem was a corrupted yum cache. I had to delete /var/cache/yum to make it work (mentioned here: access.redhat.com/solutions/203603 ). Now if I change only the epoch in my spec file, it is detected as new RPM and it is updated. If you want, update your answer so I can accept it. – 3bdalla Jun 27 '19 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.