rocky-linux / rocky-tools

MIT License
393 stars 136 forks source link

Now that CentOS 8 Stream is EOL script fails to download dependencies #215

Open TheFiZi opened 4 weeks ago

TheFiZi commented 4 weeks ago
[root@localhost temp]# ./migrate2rocky.sh -r

migrate2rocky - Begin logging at Sat 15 Jun 2024 12:52:23 PM PDT.

Removing dnf cache
Preparing to migrate CentOS Stream 8 to Rocky Linux 8.

Determining repository names for CentOS Stream 8.Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Failed to fetch info for package apr-util-ldap.x86_64.

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.

Swapping out the repos to use vault.centos.org solves the problem (Note: Following code edited by Peter Ajamian to use Rocky Linux vault.)

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://dl.rockylinux.org/vault|g' /etc/yum.repos.d/CentOS-*

Not sure if this is something you want to address in the script or not but posting here to potentially save someone else some digging.

I was able to migrate from an EOL CentOS 8 Stream to Rocky 8.10 without any problems.

pajamian commented 4 weeks ago

Indeed this is a known issue and you've found the current workaround, although I would ask that you use the copy of the stream-8 vault repos at https://dl.rockylinux.org/vault/centos/8-stream/ so that we don't hammer the limited CentOS Vault infrastructure with our migrations.

That said, I do have it very high on my todo list to fix this in migrate2rocky itself, I'm just short on free cycles to do it at the moment. Note that there is already a similar fix in migrate2rocky for CentOS Linux 8 migrations.

I'll leave this issue open for now until it gets fixed.

UPDATE: I've edited your code above to use the Rocky Linux vault instead of the original CentOS vault.

JensTimmerman commented 1 week ago

I've proposed a fix in https://github.com/rocky-linux/rocky-tools/pull/216 seems to work on my systems

pajamian commented 1 week ago

I've proposed a fix in #216 seems to work on my systems

Thank you @JensTimmerman for the PR!

Can someone else test this before I approve it? https://raw.githubusercontent.com/rocky-linux/rocky-tools/10bd9942ba9b9794d0aab87a00d31d2f7ebf912a/migrate2rocky/migrate2rocky.sh

scottchiefbaker commented 1 week ago

I just ran this updated script on an old CentOS 8 Stream server and it worked fine.

pajamian commented 1 week ago

Approved PR #216 which fixes this issue.

Going to leave this issue open a bit longer because we still need updated text to replace the outdated text shown at completion of Stream migrations.