How to collect rocky linux version offline upgrade rpm

Hi team, I want to use usb to upgrade offline Rocky linux version 9.3 to 9.4.

I try to use usb download upgrade packages in online Rocky linux version 9.4.
Then use usb upgrade offline Rocky linux version 9.3.

But when my done Install the RPM packages, offline Rocky linux version still is 9.3

Is it any rpm I miss? How to collect the related rpm or where I can collect the related rpm?

Below is I collect rpm command in online Rocky linux version 9.4.
sudo dnf --downloadonly upgrade
sudo dnf download --resolve --alldeps --refresh upgrade

On up to date 9.4 the “dnf upgrade” is 0 packages. That is not the same as 9.3 to up to date 9.4 requires.

What I do is copy entire repos with something like:

VERS=9.4
SOURCE=${MIRROR}/${VERS}
DEST=/somepath/9
for REPO in BaseOS AppStream CRB extras
do
  ${RSYNC} ${SOURCE}/${REPO}/x86_64/os/ ${DEST}/${REPO}/x86_64/os/
done

That gives me each of those repos intact, with metadata. With those local repos (set up) the dnf figures out what to update.

Hi jlehtone,

I try use below script for copying repository. But have some error.
Can you share a sample? Thanks

#!/bin/bash

# Set the version and mirror URL
VERS=9.4
MIRROR="https://at.mirrors.cicku.me/rocky/"  # Mirror URL
SOURCE="${MIRROR}/${VERS}"
DEST="/mnt/usb/"  # Destination path on the USB drive
RSYNC="rsync"  # Ensure rsync is installed

for REPO in BaseOS AppStream CRB extras
do
  ${RSYNC} ${SOURCE}/${REPO}/x86_64/os/ ${DEST}/${REPO}/x86_64/os/
done

Error:

[root@rocky94 ~]# ./dl.sh
ssh: Could not resolve hostname https: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3]
ssh: Could not resolve hostname https: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3]
ssh: Could not resolve hostname https: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3]
ssh: Could not resolve hostname https: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3]

Is the following mirror URL correct?
https://mirrors.rit.edu/rocky/

May be I shoud manual download? Only download BaseOS and AppStream?

sudo mkdir -pv /repo/BaseOS
sudo /usr/bin/rsync -avrt --progress rsync://mirrors.rit.edu/rocky/9.4/BaseOS/x86_64/os/ /repo/BaseOS

sudo mkdir -pv /repo/AppStream
sudo /usr/bin/rsync -avrt --progress rsync://mirrors.rit.edu/rocky/9.4/AppStream/x86_64/os/ /repo/AppStream

The https://mirrors.rockylinux.org/mirrormanager/mirrors does list HTTPS, HTTP, and RSYNC URLs for mirrors.
E.g.

https://at.mirrors.cicku.me/rocky
rsync://at.dyi.ng/rocky

https://mirrors.rit.edu/rocky
rsync://mirrors.rit.edu/rocky

The rsync does not talk HTTPS, so it cannot use those. It has to use the ‘rsync:…’ URLs.


Running a script and typing command manually are practically the same thing. A saved script is just easier to run again.


Personally, I would have used root (sudo) only as much as to make the /repo (or /mnt/usb/) writable for my regular account and then run rsync/script as my regular account. The less you do with admin privileges, the less can go horribly wrong.


If you have (only) /mnt/usb and you ask rsync to write to /mnt/usb/BaseOS/x86_64/os/ it will say “error” as it will not create the BaseOS and x86_64 intermittent directories by default. It probably has an option to do so, but since new point update appears only every six months, I’ve used manual:

mkdir -pv /mnt/usb/{AppStream,BaseOS,CRB,extras}/x86_64/os

Yes.
If you have not installed any packages from extras or crb, then you don’t need those repos.