Edit yum configuration file vim /etc/yum/conf
vim /etc/yum/conf
Add proxy ip (without square brackets) proxy=[你要设置的代理]
proxy=[你要设置的代理]
Save, exit, ok