Error on Convert from CentOS 8 to RHEL 8

Latest response

Hi,
I am trying to convert Centos to RHEL 8 by following https://access.redhat.com/articles/2360841
and on executing this command, I am getting error:
convert2rhel --disable-submgr --enablerepo dvd-BaseOS --debug

I am getting this error:
[01/01/2021 10:29:22] DEBUG - Calling command 'yum install -y --disablerepo=* --enablerepo=dvd-BaseOS kernel-4.18.0-240.el8'
Failed loading plugin "spacewalk": No module named 'up2date_client'
Last metadata expiration check: 0:30:01 ago on Fri Jan 1 09:59:21 2021.

Dependencies resolved.

Package Arch Version Repository Size

Installing:
kernel x86_64 4.18.0-240.el8 dvd-BaseOS 4.3 M
kernel-core x86_64 4.18.0-240.el8 dvd-BaseOS 30 M
kernel-modules x86_64 4.18.0-240.el8 dvd-BaseOS 26 M
Removing:
kernel x86_64 4.18.0-147.3.1.el8_1 @anaconda 0
kernel-core x86_64 4.18.0-147.3.1.el8_1 @anaconda 58 M
kernel-modules x86_64 4.18.0-147.3.1.el8_1 @anaconda 20 M

Transaction Summary

Install 3 Packages
Remove 3 Packages

Total download size: 60 M
Downloading Packages:
Error opening file for checksum: /media/rhel8dvd/BaseOS/Packages/kernel-4.18.0-240.el8.x86_64.rpm
Package "kernel-4.18.0-240.el8.x86_64" from local repository "dvd-BaseOS" has incorrect checksum
Error opening file for checksum: /media/rhel8dvd/BaseOS/Packages/kernel-core-4.18.0-240.el8.x86_64.rpm
Package "kernel-core-4.18.0-240.el8.x86_64" from local repository "dvd-BaseOS" has incorrect checksum
Error opening file for checksum: /media/rhel8dvd/BaseOS/Packages/kernel-modules-4.18.0-240.el8.x86_64.rpm
Package "kernel-modules-4.18.0-240.el8.x86_64" from local repository "dvd-BaseOS" has incorrect checksum
Error: Some packages from local repository have incorrect checksum
Verifying that RHEL kernel has been installed
[01/01/2021 10:29:23] CRITICAL - No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages.
[01/01/2021 10:29:23] DEBUG - Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 89, in main
post_ponr_conversion()
File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 190, in post_ponr_conversion
pkghandler.preserve_only_rhel_kernel()
File "/usr/lib/python3.6/site-packages/convert2rhel/pkghandler.py", line 440, in preserve_only_rhel_kernel
verify_rhel_kernel_installed()
File "/usr/lib/python3.6/site-packages/convert2rhel/pkghandler.py", line 565, in verify_rhel_kernel_installed
"No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages.")
File "/usr/lib/python3.6/site-packages/convert2rhel/logger.py", line 105, in critical
sys.exit(msg)
SystemExit: No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages.

WARNING - Conversion process interrupted and manual user intervention will be necessary.

Responses

Hi Waqas,

I can't reproduce the checksum error. Where did you download the DVD from? What's the content of the repofile that defines the dvd-BaseOS repository? What CentOS 8 version are you using? How did you install the CentOS system?

With convert2rhel --disable-submgr --enablerepo rhel-8-baseos --debug I'm getting another error much later which is caused by not including also the other essential RHEL 8 repository - AppStream. For a successful conversion, you need to use both BaseOS and AppStream repositories. I'll make sure this information is added to the article you linked.

Try following these steps:

mkdir -p /media/rhel8dvd/
mount -o loop /path/to/rhel-8.3-x86_64-dvd.iso /media/rhel8dvd/

cat >/etc/yum.repos.d/rhel8dvd.repo <<EOFE
[rhel-8-baseos]
name=rhel-8-baseos
baseurl=file:///media/rhel8dvd/BaseOS/
enabled=1

[rhel-8-appstream]
name=rhel-8-appstream
baseurl=file:///media/rhel8dvd/AppStream/
enabled=1
EOFE

convert2rhel --disable-submgr --enablerepo rhel-8-baseos --enablerepo rhel-8-appstream --debug

Regards, Michal

I had CentOS Linux release 8.1.1911 (Core) which was upgraded to CentOS Linux release 8.3.2011. I am using openstack for VM. And I had downloaded the rhel-8.3-x86_64-dvd.iso from https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux/try-it

My repo file contains the following text:

[dvd-BaseOS] name=DVD for RHEL8 - BaseOS baseurl=file:///media/rhel8dvd/BaseOS enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[dvd-AppStream] name=DVD for RHEL8 - AppStream baseurl=file:///media/rhel8dvd/AppStream enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

I had CentOS Linux release 8.1.1911 (Core) which was upgraded to CentOS Linux release 8.3.2011. I am using openstack for VM. And I had downloaded the rhel-8.3-x86_64-dvd.iso from https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux/try-it

My repo file contains the following text:

[dvd-BaseOS] name=DVD for RHEL8 - BaseOS baseurl=file:///media/rhel8dvd/BaseOS enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[dvd-AppStream] name=DVD for RHEL8 - AppStream baseurl=file:///media/rhel8dvd/AppStream enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

With those two repositories you have configured, enable both when executing convert2rhel, i.e.:

convert2rhel --disable-submgr --enablerepo dvd-BaseOS --enablerepo dvd-AppStream --debug

Let me know if it works.

Thanks, it worked

The Convert2RHEL KB article has been updated to clarify the need for both RHEL 8 repositories.

We are also testing the conversion but getting the following error "CRITICAL - No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages" when using the following as the Custom Repo [rhel-8-baseos] name=rhel-8-baseos baseurl=http://10.25.1.41/packages/rel8dvd/BaseOS/ enabled=1

[rhel-8-appstream] name=rhel-8-appstream baseurl=http://10.25.1.41/packages/rel8dvd/AppStream/ enabled=1

OS being converted CentOS 8.3.2011

The conversion works when the DVD is mounted directly on the instance to be converted. The servers being converted does not have direct access to the internet

Hi Manley,

  1. How do you run convert2rhel? In you case it should be convert2rhel --debug --disable-submgr --enablerepo rhel-8-baseos --enablerepo rhel-8-appstream.

  2. Can you verify that there's the kernel package to be found under http://10.25.1.41/packages/rel8dvd/BaseOS/Packages?

  3. Can you verify that there's no typo in the URL, for example that the rel8dvd should not be rhel8dvd?

Regards, Michal

Hi Michael;

I am using:

 *convert2rhel  --disable-submgr --enablerepo rhel-8-baseos --enablerepo rhel-8-appstream --debug*

Kernel packages:

/var/www/html/packages/rel8dvd/BaseOS/Packages
ls -ltrh kernel*
kernel-abi-whitelists-4.18.0-80.el8.noarch.rpm
kernel-4.18.0-80.el8.x86_64.rpm
kernel-core-4.18.0-80.el8.x86_64.rpm 
kernel-cross-headers-4.18.0-80.el8.x86_64.rpm
kernel-debug-4.18.0-80.el8.x86_64.rpm
kernel-debug-core-4.18.0-80.el8.x86_64.rpm
kernel-debug-devel-4.18.0-80.el8.x86_64.rpm
kernel-debug-modules-4.18.0-80.el8.x86_64.rpm
kernel-debug-modules-extra-4.18.0-80.el8.x86_64.rpm
kernel-doc-4.18.0-80.el8.noarch.rpm
kernel-devel-4.18.0-80.el8.x86_64.rpm
kernel-headers-4.18.0-80.el8.x86_64.rpm
kernel-modules-4.18.0-80.el8.x86_64.rpm
kernel-modules-extra-4.18.0-80.el8.x86_64.rpm
kernel-tools-4.18.0-80.el8.x86_64.rpm
kernel-tools-libs-4.18.0-80.el8.x86_64.rpm

Url is correct:

    http://10.25.1.41/packages/rel8dvd/BaseOS/

Manley, please post here the output of convert2rhel starting with the TASK - [Convert: Prepare kernel] message up until the CRITICAL - No RHEL kernel installed.

That TASK - [Convert: Prepare kernel] is the step that is supposed to install the RHEL kernel. I need the information about what is happening before the CRITICAL error.

Hi Michael, As requested,

[04/27/2021 17:40:01] TASK - [Convert: Prepare kernel] ******************************************
Installing RHEL kernel ...
[04/27/2021 17:40:01] DEBUG - Calling command 'yum install -y --disablerepo=* --releasever=8 --setopt=module_platform_id=platform:el8 --enablerepo=rhel-8-baseos --enablerepo=rhel-8-appstream kernel'
Failed loading plugin "spacewalk": No module named 'up2date_client'
Last metadata expiration check: 0:02:45 ago on Tue Apr 27 17:37:16 2021.
Package kernel-4.18.0-193.19.1.el8_2.x86_64 is already installed.
Package kernel-4.18.0-193.28.1.el8_2.x86_64 is already installed.
Package kernel-4.18.0-240.15.1.el8_3.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Conflict of kernels: One of the installed kernels has the same version as the latest RHEL kernel.
[04/27/2021 17:40:02] DEBUG - Calling command 'yum list -y --disablerepo=* --releasever=8 --setopt=module_platform_id=platform:el8 --enablerepo=rhel-8-baseos --enablerepo=rhel-8-appstream --showduplicates kernel'
[04/27/2021 17:40:02] DEBUG - Calling command 'yum install -y --disablerepo=* --releasever=8 --setopt=module_platform_id=platform:el8 --enablerepo=rhel-8-baseos --enablerepo=rhel-8-appstream kernel-4.18.0-80.el8'
Failed loading plugin "spacewalk": No module named 'up2date_client'
Last metadata expiration check: 0:02:46 ago on Tue Apr 27 17:37:16 2021.
Dependencies resolved.
================================================================================
 Package           Arch      Version                     Repository        Size
================================================================================
Installing:
 kernel            x86_64    4.18.0-80.el8               rhel-8-baseos    400 k
 kernel-core       x86_64    4.18.0-80.el8               rhel-8-baseos     24 M
 kernel-modules    x86_64    4.18.0-80.el8               rhel-8-baseos     20 M
Removing:
 kernel            x86_64    4.18.0-193.19.1.el8_2       @BaseOS            0
 kernel-core       x86_64    4.18.0-193.19.1.el8_2       @BaseOS           60 M
 kernel-modules    x86_64    4.18.0-193.19.1.el8_2       @BaseOS           20 M

Transaction Summary
================================================================================
Install  3 Packages
Remove   3 Packages

Total download size: 44 M
Downloading Packages:
(1/3): kernel-4.18.0-80.el8.x86_64.rpm           70 MB/s | 400 kB     00:00
(2/3): kernel-modules-4.18.0-80.el8.x86_64.rpm  135 MB/s |  20 MB     00:00
(3/3): kernel-core-4.18.0-80.el8.x86_64.rpm      99 MB/s |  24 MB     00:00
--------------------------------------------------------------------------------
Total                                           184 MB/s |  44 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : kernel-core-4.18.0-80.el8.x86_64                       1/6
  Running scriptlet: kernel-core-4.18.0-80.el8.x86_64                       1/6
  Installing       : kernel-modules-4.18.0-80.el8.x86_64                    2/6
  Running scriptlet: kernel-modules-4.18.0-80.el8.x86_64                    2/6
  Installing       : kernel-4.18.0-80.el8.x86_64                            3/6
  Erasing          : kernel-4.18.0-193.19.1.el8_2.x86_64                    4/6
  Running scriptlet: kernel-4.18.0-193.19.1.el8_2.x86_64                    4/6
  Erasing          : kernel-modules-4.18.0-193.19.1.el8_2.x86_64            5/6
  Running scriptlet: kernel-modules-4.18.0-193.19.1.el8_2.x86_64            5/6
  Running scriptlet: kernel-core-4.18.0-193.19.1.el8_2.x86_64               6/6
sed: can't read /etc/system-release: No such file or directory

  Erasing          : kernel-core-4.18.0-193.19.1.el8_2.x86_64               6/6
  Running scriptlet: kernel-core-4.18.0-193.19.1.el8_2.x86_64               6/6
  Running scriptlet: kernel-core-4.18.0-80.el8.x86_64                       6/6
sed: can't read /etc/system-release: No such file or directory

  Running scriptlet: kernel-core-4.18.0-193.19.1.el8_2.x86_64               6/6
  Verifying        : kernel-4.18.0-80.el8.x86_64                            1/6
  Verifying        : kernel-core-4.18.0-80.el8.x86_64                       2/6
  Verifying        : kernel-modules-4.18.0-80.el8.x86_64                    3/6
  Verifying        : kernel-4.18.0-193.19.1.el8_2.x86_64                    4/6
  Verifying        : kernel-core-4.18.0-193.19.1.el8_2.x86_64               5/6
  Verifying        : kernel-modules-4.18.0-193.19.1.el8_2.x86_64            6/6

Installed:
  kernel-4.18.0-80.el8.x86_64              kernel-core-4.18.0-80.el8.x86_64
  kernel-modules-4.18.0-80.el8.x86_64

Removed:
  kernel-4.18.0-193.19.1.el8_2.x86_64
  kernel-core-4.18.0-193.19.1.el8_2.x86_64
  kernel-modules-4.18.0-193.19.1.el8_2.x86_64

Complete!
Verifying that RHEL kernel has been installed
CRITICAL - No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages.
[04/27/2021 17:40:37] DEBUG - Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 99, in main
    post_ponr_conversion()
  File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 217, in post_ponr_conversion
    pkghandler.preserve_only_rhel_kernel()
  File "/usr/lib/python3.6/site-packages/convert2rhel/pkghandler.py", line 535, in preserve_only_rhel_kernel
    verify_rhel_kernel_installed()
  File "/usr/lib/python3.6/site-packages/convert2rhel/pkghandler.py", line 659, in verify_rhel_kernel_installed
    "No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages.")
  File "/usr/lib/python3.6/site-packages/convert2rhel/logger.py", line 103, in _critical
    sys.exit(msg)
SystemExit: No RHEL kernel installed. Verify that the repository used for installing kernel contains RHEL packages.

WARNING - Conversion process interrupted and manual user intervention will be necessary.
[root@c8r803 ~]#

Manley, it seems you've got a very old kernel from RHEL 8.0 served by the webserver. We do not test or support conversions to RHEL 8.0.

Citing the official guide Converting from an RPM-based Linux distribution to RHEL: "Custom repositories configured in the /etc/yum.repos.d/ directory and pointing to a mirror of the latest RHEL minor version repositories. ... Make sure that the repositories contain the latest content available for that RHEL minor version to prevent downgrading and potential conversion failures."

The last sentence tells us that with DVDs in general one can't satisfy the requirement because the packages on the DVD are out-of-date already within days of the DVD release. For a supported conversion, you need to provide custom repositories with the latest RHEL 8.3 packages, including all the available updates.

However if you're not after a supported conversion but want to just try the conversion in an unsupported fashion, try downloading the latest RHEL 8 DVD, currently it's RHEL 8.3, and provide its content through the webserver. That should help.

HI Michael,

The repo on the web sever was created from the contents of the DVD rhel-8.3-x86_64-dvd.

I will work on getting the latest 8.3 packages to create the offline repo and test again

Thank you

Please verify everything went well when copying the DVD content or mounting the DVD because the rhel-8.3-x86_64-dvd.iso contains in my case just one kernel and it's the kernel-4.18.0-240.el8.x86_64.rpm.

I will double check copy versus the DVD and try again

Thank you

Hi Michael

When using Convert2Rhel and Satellite, we can pass the location of ubi repo?

The conversion is trying to pull files from https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os

These severs does not have Internet Access. We get the following error message.

*CRITICAL - Unable to download the subscription-manager package or its dependencies. See details of the failed yumdownloader call above. These packages are necessary for the conversion unless you use the --disable-submgr option. *

HI

I was able to use convert2rhel --org organization_ID --activationkey activation_key --debug to complete a conversion with my Satellite after modifying baseurl for UBI to point to local repo in the following file

/usr/lib/python3.6/site-packages/convert2rhel/subscription.py

Can this be set on the command line when stating convert2rhel?

No, it can't be set through a command line. We were not considering this scenario but it's definitely a valid one. Thanks for pointing out this limitation. We'll consider adding such an option.

It should be an option because assuming servers have internet access is definitely not something "enterprise ready". Moreover, the activationkey should be quoted, just in case people used spaces...

  • registration_cmd += " --activationkey=%s" % tool_opts.activation_key
  • registration_cmd += " --activationkey='%s'" % tool_opts.activation_key

Hi Etudes, thanks for the feedback. We're already started working on enabling the conversions of systems not connected to the Internet using Red Hat Satellite 6 repositories: https://github.com/oamg/convert2rhel/pull/294.

Regarding the activation key, I've just tried to create one with a space in the Customer Portal and I got an error "Name may only contain letters, numbers, underscore, or hyphen". But in Red Hat Satellite 6.9 I was indeed able to create one with a space. Here's a fix you suggested to allow the spaces in the key: https://github.com/oamg/convert2rhel/pull/301.

We've tried using convert2rhel .18 & .20 and get the same error when running connected - seems to be the last step when doing the distro-sync - the tool says "centos-gpg-keys package is not installed" and errors out - yes it is installed. It can't be removed early in the process as setup.noarch is a dependency. We can remove the centos package once the tool errors out and all seems fine, the system registers OK - the satellite thinks it is RHEL8.3. Our customer has thousands of systems to convert and I/we don't want to tell them to ignore the error. We are testing with the "CentOS-8-GenericCloud-8.3.2011-20201204.2.x86_64.qcow2" image. Disconnected mode runs flawlessly so it seems to be a subscription-manager issue.

Hi Bruce, please send me ideally the whole /var/log/convert2rhel/convert2rhel.log. I need to see what steps have been taken till the error and what the error exactly says. By the way, I don't think the "centos-gpg-keys" is the cause of the error but I may be wrong. We're dealing with the package in https://github.com/oamg/convert2rhel/pull/248 and the change will be included in 0.21. But, I'm not sure if this change is going to solve the issue you're mentioning. I need to see the log.

Unfortunately I'm testing in a secure environment that will not allow the transfer of any kind of document to the outside world. I have to re-type everything so it will have to be abbreviated. Any thoughts on why it can't see "centos-gpg-keys" when it is definitely there? ( dnf can see it as well as rpm -qa )And maybe why once the convert finishes setup.noarch is no longer a dependency? The centos-gpg-keys is the last remnant of centos on the system. I'll get the error to you shortly in more detail.

The first error is caused by "yum distro-sync -y --disablerepo=* --releasever=8 --setopt=module_platform_id=platform:el8 --enablerepo=rhel-8-for-x86_64-baseos-rpms --enablerepo=rhel-8-for-x86_64-appstream-rpms centos-gpg-keys" BaseOS repo AppStream repo No package centos-gpg-keys installed Error: No packages marked for distro sync Rec'd return code 1

Resolving dependencies Checking for problematic pkgs

No other pkgs to downgrade Checking for problematic pkgs

CRITICAL - Could not resolve yum errors. Traceback....... main.py line 99 post ponr conversion main.py line 210 post ponr conversion pkghandler.replace_non_red_hat_packages pkghandler.py line 519 in replace_non_red_hat_packages call_yum_cmd_w_downgrades(cmd, orig_os_pkgs + submgr_pkgs) pkghandler.py line line 77 in call_yum_cmd_w_downgrades - "Critical logger message" System exit: Could not resolve yum errors. WARNING - Conversion process interrupted and manual user intervention will be necessary

back to command prompt - verified centos-gpg-keys is installed - but now it can be removed with no deps.

If we can get the centos-gpg-keys off of the end of the distro-sync it runs perfect.

The beginning of the problem : Performing reinstallation of the CentOS Linux packages ... (including centos-gpg-keys) .... .... .... Installed package centos-gpg-keys-1:8-2.el8.noarch (from anaconda) not available

It is the only package with centos in it's name that yum tries to reinstall - of course it can't re-install something that does not exist in the Red Hat repos

We are aware of this package being incorrectly tried to be reinstalled - we've got a fix ready and it will be part of the next version https://github.com/oamg/convert2rhel/pull/248.

Before the new version is available, you can manually add the centos-gpg-keys to the /usr/share/convert2rhel/configs/centos-8-x86_64.cfg file, under the excluded_pkgs key.

Tried adding excludes to yum.conf and the repo files - didn't work. Probably need to add that functionality to the python package handler.

I fear you've hit a bug we know about - the yum distro-sync returns 1 for failure even though there's no failure ("No packages marked for distro sync"). This is a different behavior than the other yum commands. This bug is tracked under https://issues.redhat.com/browse/OAMG-4600.

Before we fix that, when you see convert2rhel to fail on distro-sync with the message "No packages marked for distro sync", you can consider the conversion successful. We'll try to get to it as soon as possible.