# How to collect rocky linux version offline upgrade rpm

**URL:** <https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [September 10, 2024, 4:20am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772 "2024-09-10T04:20:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike.ng](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@mike.ng](https://forums.rockylinux.org/u/mike.ng)\
**Post date:** [September 10, 2024, 4:20am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772/1 "2024-09-10T04:20:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [September 10, 2024, 6:45am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772/2 "2024-09-10T06:45:29Z")

</div>

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:

```bash
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.

---

<div class="post-metadata">

**Author:** ![mike.ng](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@mike.ng](https://forums.rockylinux.org/u/mike.ng)\
**Post date:** [September 10, 2024, 8:57am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772/3 "2024-09-10T08:57:33Z")

</div>

Hi jlehtone,

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

```auto
#!/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:

```auto
[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/](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

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [September 10, 2024, 10:21am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772/4 "2024-09-10T10:21:35Z")

</div>

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

```auto
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_:

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

```

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [September 10, 2024, 10:23am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772/5 "2024-09-10T10:23:00Z")

</div>

> [@mike.ng](#):
>
> Only download BaseOS and AppStream?

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [November 9, 2024, 10:24am UTC](https://forums.rockylinux.org/t/how-to-collect-rocky-linux-version-offline-upgrade-rpm/15772/6 "2024-11-09T10:24:01Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
