Reposync Specific versions (8.5, 8.6)


I’m trying to do an individual reposync on the specific versions of RockyLinux for a disconnected environment. Yet the problem I’m facing is I only want to pull specific packages for 8.5, and then for 8.6 to keep them separate.

I’m having issues as ‘dnf --releasever=8.5 update’ comes back with an error. Is there a different version I need to be looking for and how do I find it?


First, I don’t know reposync. I’ve only used lftp/rsync to clone directories from nearest mirror.

Second, the 8.5 repos are already in their final form; no more updates, only removal sooner or later. Therefore, you only need to get a copy of them once. The 8.6 repos, the ones currently visible, will get updates until 8.7 is released so them you should sync regularly.

Let say you have two local repositories ‘my-baseos’ and ‘my-baseos85’. If both are enabled, then latest version for each package is in ‘my-baseos’.

You could run dnf --disablerepo=my-baseos up. If you have still some packages in “not the latest 8.5 version”, then those do update to latest that is in ‘my-baseos85’.
However, you can’t run dnf up because that updates all packages to what the ‘my-baseos’ has – to 8.6 versions.

Ok, you can perhaps sync the ‘my-baseos’ partially, to leave out packages that you want to stay at 8.5 versions. With all the dependencies and repository metadata that can be inconvenient.

How about comfiguration management? Rocky has now package ansible-core. Ansible. You can list for Ansible the packages that you do want to be installed. The list can state the versions too. An example “playbook”:

- hosts: all
  - name: These packages must be installed
      name: "{{ packages }}"
      state: present
      - dnf
      - NetworkManager-1:1.32.10-4.el8  # force a version from 8.5
      - openssh-server

Playbooks are run with ansible-playbook.

You have to list the packages that you want to have in specific version, but that you have to do somehow anyway. With this approach you can have “everything” in your local repos, which keeps the sync-part simple.

@jlehtone, so currently I run something like this…

dnf reposync -g --delete -p /data/RockyLinux/ --repoid=baseos --newest-on ly --download-metadata

Once I hit each repo I then zip and transfer them, unzip and run “createrepo .”

rsync would be a faster method as I wouldn’t need to run “createrepo .” yet I couldn’t get rsync to work it was giving a bunch of errors so I used reposync instead.

Yet if I pull the reposync now it’ll pull the 8.6 packages but I want to get a finalized version of 8.5 thats up-to-date to achieve and then go to 8.6.

What is your rsync command to sync? I can test it out and see if it works for me potentially.

Something like this, except this is for AlmaLinux repos:


RSYNC="/usr/bin/rsync -aqH --no-g --no-o --delete --delay-updates --bwlimit=1024"
# AlmaLinux

for R in BaseOS AppStream PowerTools extras
  ${RSYNC} --exclude="SRPMS/" ${SOURCE}/${R}/x86_64/os/ ${DEST}/${R}/x86_64/os/

How do you defeat the issue of creating all the directories? Do you just create them all in advance?

Yes. At the same time I update the script to fetch a new point update. For the above 8.6 I did:

mkdir -p /site/mirrors/{BaseOS,AppStream,PowerTools,extras}/x86_64/os