Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Private repository - update so new rpms can be pulled immediately

Tags:

rpm

rpmbuild

I setup a private repository (local mount for now) and built custom rpms. The idea is to build the rpm, add it to the repo, and trigger a yum update mypackage to several servers.

The problem I'm having is that the newer version of the rpm does not show up... and the old version of the rpm still does, even after I delete it from the repo.

I've tried yum update and yum clean all but it does not get the latest data in my local repo.

When I uninstall the package, and re-install it, it tries to install the old rpm that is no longer present, and fails.

What is the process to update the repo data so I can run updates immediately?

** update **

As I was writing this, I thought to try createrepo . after I updated the rpms. This allowed me to install the latest version.

Is this what I should run after updating the files?

like image 302
Coder1 Avatar asked Dec 27 '22 12:12

Coder1


2 Answers

The fastest way to rebuild your repository metadata is to use the --update flag for createrepo:

createrepo --update -v /path/to/repo

This will only process RPMs added to your repo since the last time createrepo was run.

like image 190
Steve Goodman Avatar answered Apr 08 '23 15:04

Steve Goodman


Fge's comment is correct. Every time you add a new rpm to a repository you must run createrepo. Otherwise the repo metadata doesn't get updated so it still sees the previous RPM as the latest version.

Edit: The docs that I linked to that explained the same steps as the answer below by Steve Goodman were removed for some reason, check out that answer instead (https://stackoverflow.com/a/18604484/1263015)

like image 26
Forrest Avatar answered Apr 08 '23 16:04

Forrest