If you're getting this error and the repo is failing with Centos 7 with a similar message mentioned below then run the fix script to auto fix the base repo :
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"
Due to EOL the mirrorlist.centos.org doesn't exist anymore and removed you need to change the repo to vault.centos.org
you need to run the below script on your server :
curl -s -L https://www.alphagnu.com/upload/centos7-repo-fix.sh | bash