Local Repo update question

Hey guys,

I’m trying to setup a local repo for packages that I’m creating, I installed httpd and createrepo, I created a folder for the repo and ran createrepo /var/www/html/repos, but when I put rpms in it dnf/yum fail to syncronize/cache what’s in it, what do I have to do so yum/dnf recognize what’s in the repo?

Thanks.

Heya—sorry, not clear about this. Did you run createrepo before adding the rpms? If so, that’s the wrong order. You first put the rpms in, then run createrepo. It will create the “repodata” which dnf/yum will then use.

1 Like

The steps:

  • Put rpms in /var/www/html/repos/
  • run createrepo /var/www/html/repos/
  • open gedit or any favourite text editor of yours and add the following texts into it

[local-repo]
name=My local Repository
failovermethod=priority
baseurl=file:///var/www/html/repos
cost=300
enabled=1
gpgcheck=0

  • Save the text file as “local.repo
  • Move local.repo into /etc/yum.repos.d/ (mv ./local.repo /etc/yum.repos.d/)

You can now run dnf. The above configuration assumes that the repo is on the same machine – otherwise the baseurl should be something like this: http://your-hostname/repos/ (i.e. assumig your local repo is being served by apache)