To enable yum through proxy server, open the yum.conf configuration file present in /etc/yum.conf as root
Edit yum.conf and put the http proxy server address and proxy port number in yum.conf main section
If your proxy requires a user name and password then append them also as shown below.
[main] proxy=http://*.*.*.*:8080 # put your http proxy here followed by port number proxy_username=your_username #replace your_username with your username proxy_password=your_password #replace your_password with password of your username cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3 # This is the default, if you make this bigger yum won't see if the metadata # is newer on the remote and so you'll "gain" the bandwidth of not having to # download the new metadata and "pay" for it by yum not having correct # information. # It is esp. important, to have correct metadata, for distributions like # Fedora which don't keep old packages around. If you don't like this checking # interupting your command line usage, it's much better to have something # manually check the metadata once an hour (yum-updatesd will do this). # metadata_expire=90m
#yum clean all