As the mirrors for CentOS 8.5 are now deprecated, you will need to use the CentOS archive repo. You can do this by editing the /etc/yum.repos.d/CentOS-Linux-AppStream.repo and /etc/yum.repos.d/CentOS-Linux-BaseOS.repo files as follows (I’ll give one example, do the same for each file):
If you run dnf update the command should run successfully. If you see an error as before, it will be because you have another repo enabled that is now offline.