Skip to content

Instantly share code, notes, and snippets.

@hkneptune
Created February 17, 2022 02:00
Show Gist options
  • Save hkneptune/4961532c2df691db79a1c6b72c251b25 to your computer and use it in GitHub Desktop.
Save hkneptune/4961532c2df691db79a1c6b72c251b25 to your computer and use it in GitHub Desktop.
Upgrade CentOS Linux 8 to CentOS Stream 8

Fix the AppStream Issue

[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.

  1. 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-*
  1. Get the packages update.
dnf update

Upgrade to CentOS Stream

  1. Apply the above step to fix the mirror issue.
  2. Perform package cleanup to ensure no packages error be raised.
dnf clean packages
  1. Install the CentOS Release Stream package.
dnf install centos-release-stream -y --allowerasing
  1. Synchronize installed packages to the latest versions.
dnf distro-sync -y
  1. Restart the server.
reboot
  1. Verify the upgrade result.
cat /etc/centos-release

The result should be same as below.

CentOS Stream release 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment