Solution to CentOS 8 AppStream Error

As explained here, Centos mirrors have been migrated to vault.centos.org.

Then the solution is:

cp -r /etc/yum.repos.d /etc/yum.repos.d.old
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-*
yum clean all
yum -y update

After this you can again use the yum command but you won’t received recent updates because Centos mirrors are not maintained anymore.

Alternative to Red Hat CentOS 8: Migrate to RockyLinux

If you want recent updates for your packages, then migrate to RockyLinux (before you should follow the script above).

Just follow this: https://docs.rockylinux.org/guides/migrate2rocky/ or you can find it also here:

dnf install -y git
git clone https://github.com/rocky-linux/rocky-tools.git
cd rocky-tools
cd migrate2rocky
chmod u+x migrate2rocky.sh
./migrate2rocky.sh -r

That “-r” option tells the script to just go ahead and install everything.