Due to the fact that CentOS 8 is no longer supported, its repositories begin to be unavailable and give errors.
If you encounter this error, we recommend switching to the current OS - OEL 8.
If for some reason you cannot switch OS, then to correct this error, it is enough to enter 2 commands:
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-*
Done!