Skip to content

Instantly share code, notes, and snippets.

@yodermk
Created February 13, 2022 19:08
Show Gist options
  • Save yodermk/9c8081a70ec4e0f2ffca8d6c3603da32 to your computer and use it in GitHub Desktop.
Save yodermk/9c8081a70ec4e0f2ffca8d6c3603da32 to your computer and use it in GitHub Desktop.
Commands to live-upgrade CentOS Streams 8 -> 9
# The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/
#
# It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here.
yum upgrade
reboot
dnf install epel-release
dnf install rpmconf
dnf install yum-utils
rpmconf -a # answer "n" to both things
package-cleanup --leaves
package-cleanup --orphans
dnf install http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-9.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-9.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-9.el9.noarch.rpm
curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
curl -O https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
rpm -Uvh *.rpm
yum update
dnf clean all
rpm -e `rpm -q kernel`
dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync
dnf clean all
reboot
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
dnf -y groupupdate "Core" "Minimal Install"
@yodermk
Copy link
Author

yodermk commented Feb 17, 2022

not seeming to do anything now.

[root@toolbox ~]# dnf module disable python36 python39 perl perl-IO-Socket-SSL perl-libwww-perl
Last metadata expiration check: 0:01:06 ago on Thu 17 Feb 2022 02:33:23 AM UTC.
Modular dependency problems:

 Problem 1: conflicting requests
  - nothing provides module(platform:el8) needed by module python36:3.6:8050020210825152031:982725ab.x86_64
 Problem 2: conflicting requests
  - nothing provides module(platform:el8) needed by module virt:rhel:8060020220208213251:d63f516d.x86_64
Unable to resolve argument python39
Unable to resolve argument perl
Unable to resolve argument perl-IO-Socket-SSL
Unable to resolve argument perl-libwww-perl
Error: Problems in request:
missing groups or modules: python39, perl, perl-IO-Socket-SSL, perl-libwww-perl
Modular dependency problems:

 Problem: conflicting requests
  - nothing provides module(platform:el8) needed by module virt:rhel:8060020220208213251:d63f516d.x86_64

@aadnehovda
Copy link

aadnehovda commented Feb 17, 2022

Yes, I guess those were only those modules I happened to have installed. You should check the currently enabled modules on your system with
dnf module list. I had some that were "orphaned" and once disabled the warnings were gone.

@kintarowonders
Copy link

kintarowonders commented Mar 17, 2022

I've had issues at this step...

# rpm -e `rpm -q kernel`
error: /usr/lib/rpm/macros.d/macros.php74-config: line 3: Macro %undefine is a built-in (%define)
warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend.
error: /usr/lib/rpm/macros.d/macros.php74-config: line 3: Macro %undefine is a built-in (%define)
warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend.
warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend.
error: cannot open Packages index using bdb_ro - Operation not permitted (1)
error: cannot open Packages database in /var/lib/rpm

I fixed this issue by rebuilding the RPM database...

rpm --rebuilddb

After completing these steps I get these errors every time I use dnf...

Problem 1: conflicting requests
 - nothing provides module(platform:el8) needed by module composer:2:20220317110346:00000000.x86_64
Problem 2: conflicting requests
 - nothing provides module(platform:el8) needed by module container-tools:rhel8:8060020211019153644:2e213529.x86_64
Problem 3: conflicting requests
 - nothing provides module(platform:el8) needed by module httpd:2.4:8050020211112043353:b4937e53.x86_64
Problem 4: conflicting requests
 - nothing provides module(platform:el8) needed by module mariadb:10.3:8030020210419150013:30b713e6.x86_64
Problem 5: conflicting requests
 - nothing provides module(platform:el8) needed by module nginx:1.14:8000020211221191913:55190bc5.x86_64
Problem 6: conflicting requests
 - nothing provides module(platform:el8) needed by module perl:5.26:8000020190628020724:55190bc5.x86_64
Problem 7: conflicting requests
 - nothing provides module(platform:el8) needed by module perl-DBD-MySQL:4.046:8030020200716171139:3a70019f.x86_64
Problem 8: conflicting requests
 - nothing provides module(platform:el8) needed by module perl-DBI:1.641:8030020200716150652:1e4bbb35.x86_64
Problem 9: conflicting requests
 - nothing provides module(platform:el8) needed by module perl-IO-Socket-SSL:2.066:8040020200924212038:1aedcbfe.x86_64
Problem 10: conflicting requests
 - nothing provides module(platform:el8) needed by module perl-libwww-perl:6.34:8040020211102170116:bf75fe78.x86_64
Problem 11: conflicting requests
 - nothing provides module(platform:el8) needed by module php:remi-7.4:20220317110346:00000000.x86_64
Problem 12: conflicting requests
 - nothing provides module(platform:el8) needed by module python36:3.6:8050020210825152031:982725ab.x86_64
Problem 13: conflicting requests
 - nothing provides module(platform:el8) needed by module ruby:2.5:8050020210527144607:b4937e53.x86_64
Problem 14: conflicting requests
 - nothing provides module(platform:el8) needed by module subversion:1.10:8030020210222042748:9ce6d490.x86_64
Problem 15: conflicting requests
 - nothing provides module(platform:el8) needed by module varnish:6:8050020211109225449:b4937e53.x86_64
Problem 16: conflicting requests
 - nothing provides module(platform:el8) needed by module virt:rhel:8060020220208213251:d63f516d.x86_64
Error: 
Problem: cannot install the best candidate for the job
 - nothing provides insights-client needed by rhc-1:0.2.1-4.el9.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

I have asked the Unix & Linux Stackexchange for help with the above problem: https://unix.stackexchange.com/questions/694789/conflicting-requests-after-update-to-centos-9-stream-from-8

I have the following modules from when the system was CentOS 8 Stream and just need to remove them all at once to fix things...

composer             2 [e]        common   Dependency Manager for PHP                                                    
container-tools      rhel8 [e]    common   Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc,
                                            conmon, CRIU, Udica, etc as well as dependencies such as container-selinux bu
                                           ilt and tested together, and updated as frequently as every 12 weeks.         
httpd                2.4 [e]      common,  Apache HTTP Server                                                            
                                  devel, m                                                                               
                                  inimal                                                                                 
javapackages-runtime 201801 [e]   common   Basic runtime utilities to support Java applications                          
mariadb              10.3 [e]     client,  MariaDB Module                                                                
                                  galera,                                                                                
                                  server                                                                                 
nginx                1.14 [e]     common   nginx webserver                                                               
perl                 5.26 [e]     common,  Practical Extraction and Report Language                                      
                                  minimal                                                                                
perl-DBD-MySQL       4.046 [e]    common   A MySQL interface for Perl                                                    
perl-DBI             1.641 [e]    common   A database access API for Perl                                                
perl-IO-Socket-SSL   2.066 [e]    common   Perl library for transparent TLS                                              
perl-libwww-perl     6.34 [e]     common   A Perl interface to the World-Wide Web                                        
php                  remi-7.4 [e] common,  PHP scripting language                                                        
                                  devel, m                                                                               
                                  inimal                                                                                 
python36             3.6 [e]      build, c Python programming language, version 3.6                                      
                                  ommon                                                                                  
ruby                 2.5 [e]      common   An interpreter of object-oriented scripting language                          
subversion           1.10 [e]     common,  Apache Subversion                                                             
                                  server                                                                                 
varnish              6 [e]        common   Varnish HTTP cache                                                            
virt                 rhel [e]     common   Virtualization module     

@brad-x
Copy link

brad-x commented Jun 8, 2022

You can remove the modules by deleting their metadata files from /etc/dnf/modules.d/

@ronen-fr
Copy link

'rpmconf -a' poses 6 question...
For now - I've answered 'no' to all.

@akelling
Copy link

Ran into some broken dependancys where system was reporting nothing

Problem 1: conflicting requests -needed by module container-tools:rhel8:8070020220921123537:39077419.x86_64
Problem 2: conflicting requests - nothing provides module(platform:el8) needed by module perl:5.26:8000020190628020724:55190bc5.x86_64 Problem 3: conflicting requests - nothing provides module(platform:el8) needed by module perl-IO-Socket-SSL:2.066:8040020200924212038:1aedcbfe.x86_64
Problem 4: conflicting requests - nothing provides module(platform:el8) needed by module perl-libwww-perl:6.34:8040020211102170116:bf75fe78.x86_64
Problem 5: conflicting requests - nothing provides module(platform:el8) needed by module python36:3.6:8050020210825152031:982725ab.x86_64
Problem 6: conflicting requests - nothing provides module(platform:el8) needed by module satellite-5-client:1.0:8010020191114035551:cdc1202b.x86_64
Problem 7: conflicting requests - nothing provides module(platform:el8) needed by module virt:rhel:8070020220921151759:3b9f49c4.x86_64

Just ran the following for each of them:
dnf module reset virt

@idc77
Copy link

idc77 commented Feb 11, 2023

current line

dnf install http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-18.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-18.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-18.el9.noarch.rpm

@idc77
Copy link

idc77 commented Feb 11, 2023

What to do about
warning: Signature not supported. Hash algorithm SHA1 not available.

A Google search leads to https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9
but that doesn't solve anything

Nevermind.. after removing the old kernel, despite the new kernel being installed, the system hangs at grub.
Just once I'd like to use something professionals create.

@oqolopo
Copy link

oqolopo commented Feb 13, 2023

You can remove the modules by deleting their metadata files from /etc/dnf/modules.d/

The simplest method.

@mcgru
Copy link

mcgru commented May 17, 2023

why 3 lines instead of one?
dnf install epel-release rpmconf yum-utils

@hezd1
Copy link

hezd1 commented Aug 8, 2023

how is this second hit on google? dont do dis guys

@RaineKos
Copy link

RaineKos commented Jan 7, 2024

In my case this left me without a grub entry pointing to a working kernel so after the reboot grub2 failed to find a working kernel. I was able to boot off a centos iso and rescue the system to get it mounted. Then installed the iso's kernel rpm into the mounted root. Then chroot to the mounted root and performed a grub2-mkconfig. That got me a working kernel and config. Once that was all done the reboot bought me back into a working system where these steps finished cleanly. So maybe before the reboot there should be an attempt to dnf install kernel? then a grub2-mkconfig to ensure grub's configs are updated to target that new kernel.

@electroms
Copy link

Thanks, It's not exactly the configuration I used but it was interresting.
If i can i will commit a Fork wen I will finished my configuration :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment