The solution is to install yum-plugin-fastestmirror. So you may use the following command to fix it:

yum install yum-plugin-fastestmirror