# Rocky Linux 8 upgrade to Rocky Linux 9

**URL:** <https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629>\
**Category:** Rocky Linux Help & Support\
**Created:** [July 18, 2022, 2:28am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629 "2022-07-18T02:28:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RockyUsers](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RockyUsers](https://forums.rockylinux.org/u/RockyUsers)\
**Post date:** [July 18, 2022, 2:28am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/1 "2022-07-18T02:28:02Z")

</div>

I have successfully upgraded to Rocky Linux 9;

see : [百度翻译-200种语言互译、沟通全世界！](http://fanyi.baidu.com/transpage?query=https%3A%2F%2Fwww.bughz.com%2Fforum%2Fcontent-ab45806abe7c4a5f86cbf00bc16345d0-0de5e9b2b0f4487ba37b81e62e518472-1-1&from=auto&to=en&source=url&render=1)  
original: [Rocky Linux 8无缝升级Rocky Linux 9（RedHat系列均可）-RedHat-BUG汇总 - 找BUG就上BUG汇总](https://www.bughz.com/forum/content-ab45806abe7c4a5f86cbf00bc16345d0-0de5e9b2b0f4487ba37b81e62e518472-1-1)

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [July 18, 2022, 7:51am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/2 "2022-07-18T07:51:16Z")

</div>

It doesn’t work. Fails on:

```auto
dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync

```

with a whole load of perl, python dependency errors. Also, best to use official links to the Rocky mirror to be sure they are official rpm’s. This can also depend on the amount of packages installed and from what location, so the upgrade process is pretty risky. I’m attempting some other parameters, but it looks like I will have to remove some of them to get that stage to work.

Not only that, officially upgrades are not supported, therefore only clean installs are recommended by the Rocky team.

---

<div class="post-metadata">

**Author:** ![RockyUsers](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RockyUsers](https://forums.rockylinux.org/u/RockyUsers)\
**Post date:** [July 18, 2022, 8:10am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/3 "2022-07-18T08:10:35Z")

</div>

These are mentioned in the last description. The default python of linux8 is 3.6, and linux9 becomes 3.8. It will be automatically upgraded. After the upgrade is over, 3.6 will be automatically removed, but because 3.6 is used in the kernel, it does not actually exist. And 3.8 has also been created, you just need to disable or remove 3.6 from the module and it will automatically use 3.8. Unless your application is not compatible with python3.8, this method is feasible; if it is a python production environment, it is not recommended to upgrade. Because I am in a java environment and don’t rely on python, I can upgrade as much as I want and enjoy the latest system

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [July 18, 2022, 8:22am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/4 "2022-07-18T08:22:08Z")

</div>

Yeah, I had to extend it:

First failure that had to be addressed:

```auto
dnf -y --releasever=9 --allowerasing --nobest --setopt=deltarpm=false distro-sync

```

adding `--nobest` to get through it. Any package complaints I had to remove, so:

```auto
dnf remove ruby-irb

```

some of the commands in between were not needed, so the epel-rpm-macros-systemd and removing redhat-logos:

```auto
dnf module disable perl:5.26 perl-IO-Socket-SSL:2.066 perl-libwww-perl:6.34 python36:3.6 httpd javapackages-tools maven ruby virt python38

```

this command wasn’t needed as it was already installed:

```auto
dnf -y install kernel kernel-core shim

```

There were still 45+ packages from el8 still installed, so requires a cleanup:

```auto
rpm -qa | grep el8 | sort

```

technically you could do this:

```auto
dnf remove -y `rpm -qa | grep el8`

```

but I went down the list removing the leftovers just in case too much of the system got uninstalled. But I expect it would have worked though. Those packages wouldn’t upgrade so needed removing. According to the dnf update command the system was up-to-date, so these were just leftovers - most likely from the modules I was using.

And I used the official rocky mirror for the packages in the first step, so:

```auto
dnf -y install https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-release-9.0-2.1.el9.noarch.rpm https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-repos-9.0-2.1.el9.noarch.rpm https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-gpg-keys-9.0-2.1.el9.noarch.rpm

```

my system does work now with Rocky 9 though, so works but just need to be careful and the procedure will need to be edited to different installation scenarios.

---

<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:** [July 18, 2022, 8:32am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/5 "2022-07-18T08:32:56Z")

</div>

As seen on CentOS Forums:

> _“If you break it, then you can keep the pieces.”_

---

<div class="post-metadata">

**Author:** ![thiru](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@thiru](https://forums.rockylinux.org/u/thiru)\
**Post date:** [July 18, 2022, 9:42am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/6 "2022-07-18T09:42:16Z")

</div>

upgrade virtual machine running rocky 8.6 to rocky 9 following method

1. same package as your first step but using wget download package and install package separate  
rpm -ivh rocky-gpg-keys-9.0-2.1.el9.noarch.rpm  
2.dnf install --skip-broken rocky-release-9.0-2.1.el9.noarch.rpm rocky-repos-9.0-2.1.el9.noarch.rpm
2. dnf update --allowerasing
3. dnf update
4. when you run dnf update you may get following error  
warning: Found bdb\_ro Packages database while attempting sqlite backend: using bdb\_ro backend. solving this using  
[1960991 – RPM unusable following upgrade to Fedora 34: cannot open Packages index using bdb\_ro - Operation not permitted (1)](https://bugzilla.redhat.com/show_bug.cgi?id=1960991)
5. dnf install sqlite2 , restorecon -Rv /var/lib/rpm , rpmdb --rebuilddb
6. you may get this error also  
Problem …: conflicting requests refer below just reset conflict package  
[Resolve conflicting requests with perl:5.26 – it.megocollector.com](https://it.megocollector.com/linux/resolve-conflicting-requests-with-perl5-26/)  
yum module reset httpd:2.4 mariadb:10.3 nginx:1.14 perl:5.26 php:7.4 for my case
7. grub2-mkconfig -o /boot/grub2/grub.cfg [precaution step to avoid boot issue]  
Thanks

---

<div class="post-metadata">

**Author:** ![knight-of-ni](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/knight-of-ni/32/884_2.png) [@knight-of-ni](https://forums.rockylinux.org/u/knight-of-ni)\
**Post date:** [July 20, 2022, 8:22pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/7 "2022-07-20T20:22:44Z")

</div>

I have made several upgrade attempts using the information in this thread.

I have found that disabling all modules via _dnf module -y disable "_" before starting the package upgrade makes the process a lot smoother.

There have been multiple snags along the way.

Once the package upgrade process finishes, a handful of packages are corrupt, such that I cannot uninstall or even list their names. For example, here is what I see when I look for el8 packages hanging around:

```auto
$ rpm -qa | grep el8 | sort
error: rpmdbNextIterator: skipping h# 538 
Header V3 RSA/SHA1 Signature, key ID 158b3811: BAD
Header SHA256 digest: OK
Header SHA1 digest: OK
error: rpmdbNextIterator: skipping h# 1308 
Header V3 RSA/SHA1 Signature, key ID bdda8475: BAD
Header SHA256 digest: OK
Header SHA1 digest: OK
aspell-0.60.6.1-22.el8.x86_64
autogen-libopts-5.18.12-8.el8.1.x86_64
bind-export-libs-9.11.36-3.el8.x86_64
celt051-0.5.1.3-15.el8.x86_64
centos-backgrounds-80.5-2.el8.noarch
centos-indexhtml-8.0-0.el8.noarch
centos-logos-80.5-2.el8.x86_64
...

```

I can’t even tell what packages are corrupt.  
Rebuilding the rpm dB does not solve this.

---

<div class="post-metadata">

**Author:** ![knight-of-ni](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/knight-of-ni/32/884_2.png) [@knight-of-ni](https://forums.rockylinux.org/u/knight-of-ni)\
**Post date:** [July 20, 2022, 8:38pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/8 "2022-07-20T20:38:35Z")

</div>

Going to restore from a snapshot again and start over…

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [July 20, 2022, 8:56pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/9 "2022-07-20T20:56:32Z")

</div>

The rpm db from 8 to 9 changes. Errors are changing from Berkeley DB to Sqlite. If rebuilding the rpmdb in-place doesn’t work, then:

```auto
cd /var/lib/rpm
rm -f __ db. 00*
rpm --rebuilddb

```

it’s important to only remove the particular files that would be deleted by that command, and not what is in the entire directory.

That said, as you’ve found out by having issues with rpmdb, is that this is why upgrades are not supported, and clean install is recommended. There are potential other problems that can be encounted, especially when more and more packages are installed, be it from official repositories or third-party ones.

Not only that, I see you have centos packages installed, which means this is not a pure Rocky system in the first place. I guess you upgraded from CentOS in the past, so will be even more difficult and problematic.

---

<div class="post-metadata">

**Author:** ![knight-of-ni](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/knight-of-ni/32/884_2.png) [@knight-of-ni](https://forums.rockylinux.org/u/knight-of-ni)\
**Post date:** [July 21, 2022, 12:21am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/10 "2022-07-21T00:21:37Z")

</div>

Fixed.

```auto
error: rpmdbNextIterator: skipping h# 2208 
Header V3 RSA/SHA1 Signature, key ID 158b3811: BAD
Header SHA256 digest: OK
Header SHA1 digest: OK
error: rpmdbNextIterator: skipping h# 4578 
Header V3 RSA/SHA1 Signature, key ID bdda8475: BAD
Header SHA256 digest: OK
Header SHA1 digest: OK

```

In my case, this message wasn’t telling me the rpm dB was corrupt. Instead, the message is saying the gpg keys on two installed packages are no longer valid.

After a bit of searching, I realized that key ID’s 158b3811 and bdda8475 are the signing keys for the rpmfusion-free and rpmfusion-nonfree el8 repos. Two packages with these keys must not have updated, despite having installed the el9 rpmfusion repo packages and then running a dnf update.

Knowing that, I ran the update again and simply removed all rpmfusion packages before updating to el9. I then reinstalled them after the update was successful.

Boom. Fixed.

> [@iwalker](#):
>
> Not only that, I see you have centos packages installed, which means this is not a pure Rocky system in the first place. I guess you upgraded from CentOS in the past, so will be even more difficult and problematic.

Yes, you are absolutely right. Centos-backgrounds, centos-indexhtml, and centos-logos seem to be dependencies of several x11 el8 packages still hanging around. Removing those packages, however, results in losing my desktop. I need to look into this further.

This particular virtual machine is my sandbox for building (and breaking) things, so I might just leave it the way it is for now.

---

<div class="post-metadata">

**Author:** ![knight-of-ni](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/knight-of-ni/32/884_2.png) [@knight-of-ni](https://forums.rockylinux.org/u/knight-of-ni)\
**Post date:** [July 21, 2022, 12:30am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/11 "2022-07-21T00:30:58Z")

</div>

The steps below were taken on my system to upgrade to el9, avoiding any package errors, module errors, or any other errors.

Several of these steps are specific to my own system and won’t apply to you or should be generalized… for example you won’t have the same repo files lying around in your yum.repos.d folder, but it would be a good idea to clean them up before upgrading, like I did.

```auto
sudo su

cd /etc/yum.repos.d
rm -f CentOS* _copr* weewx.repo zmrepo*
mv -f Rocky-PowerTools.repo.rpmnew Rocky-PowerTools.repo

dnf remove -y rpmfusion-free-release rpmfusion-nonfree-release zoneminder-common ffmpeg libbluray zram \
              epel-rpm-macros-systemd weewx usbmuxd perl-DBI perl-IO-Socket-SSL perl-DBD-SQLite \
              lame-libs libvdpau python3-gevent python3-greenlet python3-ouimeaux python3-pyyaml xorg-x11-drv-nvidia-kmodsrc \
              mock-rpmfusion-free mock-rpmfusion-nonfree rpmfusion-free-appstream-data rpmfusion-nonfree-appstream-data

dnf module -y disable "*"

dnf install -y https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-release-9.0-2.1.el9.noarch.rpm \
               https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-repos-9.0-2.1.el9.noarch.rpm \
               https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-gpg-keys-9.0-2.1.el9.noarch.rpm

dnf -y --releasever=9 --allowerasing --nobest --setopt=deltarpm=false distro-sync

restorecon -Rv /var/lib/rpm
rpmdb --rebuilddb -v

dnf install -y https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm \
               https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm

dnf install -y mock-rpmfusion-free mock-rpmfusion-nonfree

dnf update -y

```

While my system appears to be running normally, there are 51 el8 packages still on my machine. I plan to evaluate each before deciding what to do with them.

---

<div class="post-metadata">

**Author:** ![knight-of-ni](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/knight-of-ni/32/884_2.png) [@knight-of-ni](https://forums.rockylinux.org/u/knight-of-ni)\
**Post date:** [July 21, 2022, 1:40pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/12 "2022-07-21T13:40:45Z")

</div>

Last post I promise…

I went through all 51 leftover el8 packages and, other than the ~6 packages which affected the desktop GUI, removing them had no side affects. I went ahead and removed them all.

To restore the desktop, I simply issued the following then rebooted:  
`dnf -y group install "Server with GUI"`

All el8 packages are gone and the system works normally now.

---

<div class="post-metadata">

**Author:** ![Jil](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/jil/32/1089_2.png) [@Jil](https://forums.rockylinux.org/u/Jil)\
**Post date:** [July 21, 2022, 3:08pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/13 "2022-07-21T15:08:44Z")

</div>

Sir, Thank you for these steps.

Tempted to try them on a live server.

🙂

---

<div class="post-metadata">

**Author:** ![richard10555](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@richard10555](https://forums.rockylinux.org/u/richard10555)\
**Post date:** [August 1, 2022, 8:05am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/14 "2022-08-01T08:05:26Z")

</div>

thank you for these steps!

---

<div class="post-metadata">

**Author:** ![Novaflame](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@Novaflame](https://forums.rockylinux.org/u/Novaflame)\
**Post date:** [August 10, 2022, 7:27am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/15 "2022-08-10T07:27:21Z")

</div>

I am currently trying to figure out why I can’t get dnf to not brick itself every time I try fixing it during the upgrade process, it seems like every time I fix one issue, a new one arises, I managed to get the bulk of the errors fixed, but then I get this error

```auto
Error: Transaction test error:
  file /usr/share/redhat-logos from install of rocky-logos-90.11-1.el9.x86_64 conflicts with file from package rocky-logos-86.2-1.el8.x86_64

```

I am no longer getting this error, but now I am getting the error of

```auto
Error: Transaction test error:
  file /usr/sbin/service from install of initscripts-service-10.11.4-1.el9.noarch conflicts with file from package initscripts-10.00.17-1.el8.x86_64
  file /usr/share/man/man8/service.8.gz from install of initscripts-service-10.11.4-1.el9.noarch conflicts with file from package initscripts-10.00.17-1.el8.x86_64

```

I had followed some of the advice from this thread and I am stumped.

---

<div class="post-metadata">

**Author:** ![MrJames](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/mrjames/32/2191_2.png) [@MrJames](https://forums.rockylinux.org/u/MrJames)\
**Post date:** [August 20, 2022, 9:41pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/16 "2022-08-20T21:41:42Z")

</div>

Hi @knight-of-ni,

First of all thank you for sharing those steps.

When running step

```auto
dnf -y --releasever=9 --allowerasing --nobest --setopt=deltarpm=false distro-sync

```

I am getting following conflict regarding systemd, how did you overcome it?

```auto
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /usr/lib/systemd/systemd-network-generator from install of systemd-250-6.el9_0.x86_64 conflicts with file from package systemd-networkd-250.3-1.el8.x86_64

```

Did anyone come across similar error scenario? Thanks.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [August 20, 2022, 9:44pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/17 "2022-08-20T21:44:57Z")

</div>

I think it’s saying that one of them is “el8” and the other is “el9”.

---

<div class="post-metadata">

**Author:** ![MrJames](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/mrjames/32/2191_2.png) [@MrJames](https://forums.rockylinux.org/u/MrJames)\
**Post date:** [August 20, 2022, 10:16pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/18 "2022-08-20T22:16:53Z")

</div>

Yes, thanks for the tip.

It appears that systemd-networkd is not part of baseOS.

Just needed to install EPEL Repo 9 prior to the _dnf_ command.

```auto
sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

```

---

<div class="post-metadata">

**Author:** ![knight-of-ni](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/knight-of-ni/32/884_2.png) [@knight-of-ni](https://forums.rockylinux.org/u/knight-of-ni)\
**Post date:** [August 24, 2022, 5:24pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/19 "2022-08-24T17:24:23Z")

</div>

I just ran into this too.

Issue _rpm -e --nodeps rocky-logos_ then start the upgrade again and it should work.

---

<div class="post-metadata">

**Author:** ![pajamian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pajamian/32/715_2.png) [@pajamian](https://forums.rockylinux.org/u/pajamian)\
**Post date:** [August 28, 2022, 12:08am UTC](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629/20 "2022-08-28T00:08:05Z")

</div>

I would like to once again point out once again that upgrades between major versions of Rocky Linux and the systems that result from such upgrades are not supported. Any such upgrade that you attempt is entirely at your own risk and is likely to have many many hurdles that you will need to overcome. This is not something I would recommend for any kind of production servers or any machine that has to reliably maintain any kind of uptime.

You break it you keep the pieces.

[Next page](https://forums.rockylinux.org/t/rocky-linux-8-upgrade-to-rocky-linux-9/6629.md?page=2)
