To configure a permanent proxy on a CentOS server to download packages from the official CentOS repositories, you’ll need to configure the following.
Verify if there is no other proxy configured on your server by executing the following commands:
set | grep -i proxy
env | grep -i proxy
If no output is displayed, then it means that you server is not configured to use any proxy:
Now execute vim /etc/yum.conf or vi /etc/yum.conf, if you don’t have vim installed:
Enter editing mode and add the following lines. If the proxy needs user authentication, add the username and password:
# The proxy server address and port number
# Username used for proxy authentication
Save and exit config file, now you should be able to install software from the official CentOS repositories.