oamg / convert2rhel

A tool to automate converting Oracle/CentOS/Scientific/Rocky/Alma Linux to Red Hat Enterprise Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert 2 RHEL offline

ChrisPea opened this issue · comments

i need to convert centos 7 systems to rhel in an offline environment. Repositories are proxied with sonatype nexus. But it seems that there a repositories hardcoded in the source to redhat ubi so the conversion stops

i've inserted the ubi repo in my sonatype nexus infrastructure

[LHP-ubi]
name = Red Hat RHEL UBI
enabled = 1
gpgcheck = 1
baseurl = http://repo/repository/redhat/public/ubi/dist/ubi/server/7/7Server/x86_64/os
ui_repoid_vars = basearch
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
priority=1

but errorlog is this

[2023-12-18T10:46:16+0000] TASK - [Convert: Subscription Manager - Install packages] *****************
Downloading requested packages
WARNING - Output from the yumdownloader call:
Loading "etckeeper" plugin
Not loading "fastestmirror" plugin, as it is disabled
Not loading "priorities" plugin, as it is disabled
Config time: 0.005
https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: cdn-ubi.redhat.com; Unknown error"
Trying other mirror.
failure: repodata/repomd.xml from ubi-7-convert2rhel: [Errno 256] No more mirrors to try.
https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: cdn-ubi.redhat.com; Unknown error"

CRITICAL - Couldn't download the python-syspurpose package which is needed to do a rollback of this action. Check to make sure that the CentOS Linux repositories are enabled and the package is updated to its latest version.
Note that you can choose to ignore this check when actually running a conversion by setting the environment variable 'CONVERT2RHEL_UNSUPPORTED_INCOMPLETE_ROLLBACK' but not during pre-conversion analysis.
CRITICAL - Unable to download the subscription-manager package and its dependencies. See details of the failed yumdownloader call above. These packages are necessary for the conversion unless you use the --no-rhsm option.
ERROR - (ERROR) PRE_SUBSCRIPTION::FAILED_TO_DOWNLOAD_SUBSCRIPTION_MANAGER_PACKAGES - Failed to download subscription-manager package and its dependencies.
Description: To be able to subscribe the system to Red Hat we need the subscription-manager package and its dependencies to do so. Without these packages we cannot subscribe the system and we cannot install Red Hat Enterprise Linux packages.
Diagnosis: Failed to download subscription-manager package Couldn't download the python-syspurpose package which is needed to do a rollback of this action. Check to make sure that the CentOS Linux repositories are enabled and the package is updated to its latest version.
Note that you can choose to ignore this check when actually running a conversion by setting the environment variable 'CONVERT2RHEL_UNSUPPORTED_INCOMPLETE_ROLLBACK' but not during pre-conversion analysis..
Remediation: N/A

ERROR - Skipped REMOVE_REPOSITORY_FILES_PACKAGES. Skipped because PRE_SUBSCRIPTION was not successful
ERROR - Skipped SUBSCRIBE_SYSTEM. Skipped because REMOVE_REPOSITORY_FILES_PACKAGES and PRE_SUBSCRIPTION were not successful
ERROR - Skipped ENSURE_KERNEL_MODULES_COMPATIBILITY. Skipped because SUBSCRIBE_SYSTEM was not successful
ERROR - Skipped VALIDATE_PACKAGE_MANAGER_TRANSACTION. Skipped because ENSURE_KERNEL_MODULES_COMPATIBILITY and SUBSCRIBE_SYSTEM were not successful
Writing breadcrumbs to '/etc/migration-results'.
Writing RHSM custom facts to '/etc/rhsm/facts/convert2rhel.facts'.
WARNING - Abnormal exit! Performing rollback ...

Hi @ChrisPea, since your system is offline, you don't want to use subscription-manager during the conversion but instead you should use the --no-rhsm option together with --enablerepo option which is designed for conversions of offline systems.

More on that in the documentation https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/converting_from_an_rpm-based_linux_distribution_to_rhel/index#converting-using-the-command-line_converting-from-a-linux-distribution-to-rhel - search for "custom repositories".