RedHat 8 to Rocky 8 Migration issue

Hi,

I am trying to migration my server from RedHat 8 to Rocky 8, with the migrate2rocky.sh script, but it’s blocking with my repo file. I am using my local repository for redhat and rocky servers.

Please assist me to fix this issue.

Error:

+++ safednf -y -q provides /etc/yum.repos.d/Server.repo
+++ awk ‘{print $1; nextfile}’
+++ args=()
+++ for a in “$@”
+++ [[ -n -y ]]
+++ args+=("$a")
+++ for a in “$@”
+++ [[ -n -q ]]
+++ args+=("$a")
+++ for a in “$@”
+++ [[ -n provides ]]
+++ args+=("$a")
+++ for a in “$@”
+++ [[ -n /etc/yum.repos.d/Server.repo ]]
+++ args+=("$a")
+++ dnf -y -q provides /etc/yum.repos.d/Server.repo
Error: No Matches found
++ provides=
++ return 1

  • pkg_map[$pkg]=
  • exit_message ‘Can’’‘t get package that provides /etc/yum.repos.d/Server.repo.’
  • errmsg ’
    Can’’'t get package that provides /etc/yum.repos.d/Server.repo.

  • local msg
  • msg_format msg ’
    Can’’'t get package that provides /etc/yum.repos.d/Server.repo.

  • local _var
  • _var=msg
  • shift
  • (( 1 > 1 ))
  • printf -v msg %s ’
    Can’’'t get package that provides /etc/yum.repos.d/Server.repo.

  • printf %s ’
    Can’’'t get package that provides /etc/yum.repos.d/Server.repo.

Can’t get package that provides /etc/yum.repos.d/Server.repo.

  • printf %s%s%s ‘’ ’
    Can’’'t get package that provides /etc/yum.repos.d/Server.repo.

’ ‘’

  • final_message
  • errmsg '%s ’ ‘An error occurred while we were attempting to convert your system to’ ‘Rocky Linux. Your system may be unstable. Script will now exit to’ 'prevent possible damage.

  • local msg
  • msg_format msg '%s ’ ‘An error occurred while we were attempting to convert your system to’ ‘Rocky Linux. Your system may be unstable. Script will now exit to’ 'prevent possible damage.

Can you temporarily stop using the local repos?

Yes I can, but without repository we can’t proceed this migration. because this migration script will enquire the few packages from existing OS rpm’s

In other words you can’t use remote RHEL repos – its local or nothing?

The script detects file /etc/yum.repos.d/Server.repo that is not from any package.
Idea B: edit the RHEL repo files that are from RHEL package(s) to point (baseurl) to your local RHEL repos. Then you don’t need the /etc/yum.repos.d/Server.repo.

(That is a similar workaround as what was used for CentOS Linux 8 → Rocky migration after CentOS repos vanished to vault.)

Yes this repo having valid local repo packages and it contain base url.

But I don’t understand why I am getting this error.

The error message is:

  1. The script has noticed that you define some RHEL(?) repos in a file.
  2. RHEL repo definitions should be replaced with Rocky repo definitions.
  3. Therefore, the file should be removed (by removing the package that created it)
  4. No package created that file; it is not possible to remove that file via “dnf remove

You’ve found an edge-case that makes it impossible for rocky2linux to determine which package name needs to be removed and replaced with the rocky-repos package.

Try this version of migrate2rocky (custom fix for your specific edge-case and untested):
https://raw.githubusercontent.com/pajamian/rocky-tools/indiapsr/migrate2rocky/migrate2rocky.sh

You can see the diff at:

1 Like

Is there any way, how to migrate RH8 to Rocky?

$ bash ./migrate2rocky.sh -r
migrate2rocky - Begin logging at Wed 16 Mar 2022 04:26:27 PM UTC.


Migration from Katello-modified systems is not supported by migrate2rocky. See the README file for details.

An error occurred while we were attempting to convert your system to Rocky Linux. Your system may be unstable. Script will now exit to prevent possible damage.

 A log of this installation can be found at /var/log/migrate2rocky.log

As noted in the README:

Thanks pajamina
but indiapsr tried to migrate RHEL8 and didn’t work and you made a fix for him hence the confusion how he could use for RHEL8 migration it it’s Centos only?

At a guess, probably remove all the katello packages before attempting the migration. Since this seems to be the problem causing the conflicts.

The custom script I made for indiapsr was for his specific issue and was just intended for him. The README addresses this particular issue.

Some people have been known to have success migrating if they first uninstall and reverse all changes that are applied by Katello and then after the migration they can then install Katello again, but as stated in the README such a migration is not supported and you do so at your own risk.

1 Like