I’ve created a local repository using this article [1], and it works pretty great, except that every time there a update of the rocky-release package, the public repo files get installed again, I tried to exclude that package on dnf.conf, but it causes dependencies issues.
Is there a way to avoid installing the public repo files on the client machine and use only the local file?
I would highly recommend not to delete any of the repo files that rocky-repos provides as they will just come back. I also highly recommend not holding back the rocky-* package versions in any way.
In my opinion, it would be better to do the following:
Comment out mirrorlist and uncomment baseurl on each repo
Set baseurl to your local repo URL path
When you do this, the repo files will not be overwritten as anything in /etc/yum.repos.d/ that is managed by rocky-repos is considered a configuration file, and thus will not be overwritten when updates are issued. You could also set everything to enabled=0 and then have your own custom repo file there and you would get the same effect.