How to rebuild /etc/yum.repos.d in CentOS

If you remove all the files in /etc/yum.repos.d you may see this error. You can restore using the way below. Check your version and reinstall using this way.