[root@centos8 ~]# yum update
CentOS-8 - AppStream 71 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
As CentOS Linux 8 had reached the End Of Life (EOL) on December 31st, 2021. It means that CentOS 8 will no longer receive development resources from the official CentOS project. To keep your CentOS updated, you may update the mirrors or upgrade to CentOS Stream.
- Update the mirrors.
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- Get the packages update.
dnf update
- Apply the above step to fix the mirror issue.
- Perform package cleanup to ensure no packages error be raised.
dnf clean packages
- Install the CentOS Release Stream package.
dnf install centos-release-stream -y --allowerasing
- Synchronize installed packages to the latest versions.
dnf distro-sync -y
- Restart the server.
reboot
- Verify the upgrade result.
cat /etc/centos-release
The result should be same as below.
CentOS Stream release 8