This can be easily achieved with ‚yum‘ command config file “/etc/yum.conf“ – under [main] section define the proxy settings like below
[main]
proxy=http://<Proxy-Server-IP-Address>:<Proxy_Port>
proxy_username=<Proxy-User-Name>
proxy_password=<Proxy-Password>
Just for the verification you can run beneath command to see whether you are able to fetch the packages or not