-   Red Hat (
-   -   Add a custom-built rpm to a repository (

neildomo 10-15-2008 04:42 PM

Add a custom-built rpm to a repository
We have a local repository, and I recently used rpmbuild -bb to build an rpm. I copied it over to the RPMS subdir where all the other rpms are, but it doesn't show up when I do a 'yum update pkgname' on a server. Do I have to somehow tell the repository that I put some new rpms there? Is there a tool to do this, or do I just vi a file and add the rpm names?


jailbait 10-15-2008 04:52 PM

You can add a local directory to Red Hat's list of repositories. I am uncertain about Red Hat but I would guess that the repository list is kept in /etc/yum.repos.d.

In any case you can install a rpm package which is not in any repository by using the rpm command. Something like:

rpm -i /usr/src/redhat/RPMS/i686/

Steve Stites

neildomo 10-15-2008 05:03 PM

We already have a local directory with rpms, and it's already in our yum configuration so that when we do a 'yum update|install $pkgname' it will look in this repository. The issue I'm having is that I copied an rpm into that directory, and yum doesn't seem to know that. When I try 'yum update $pkgname', it says that I already have the latest version(the rpm I build is a newer version).

I could conceivable run rpm -Uvh /path/to/$pkgname, but that kinda get's troublesome with dependencies and all, and we've established that we want to use yum for this.


jailbait 10-15-2008 05:50 PM

I think that the way you straighten yum out on what versions it has on hand is:

yum clean headers

However, I have never tried this command so take my advice with a grain of salt. Check out the command in man yum and Google and see what you think.

Steve Stites

billymayday 10-15-2008 06:01 PM

Have you tried recreating the repo with createrepo? repomd.xml, etc will need to be updated

ArfaSmif 10-15-2008 06:08 PM

You will have to use the command "createrepo" to update the repo files for your local repositry. See the man page for createrepo.

neildomo 10-15-2008 09:11 PM

Thanks! I'll look into it.

All times are GMT -5. The time now is 11:31 PM.