How to configure proxy in yum on CentOS


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:

CentOS tutorial

 

Now execute vim /etc/yum.conf or vi /etc/yum.conf, if you don’t have vim installed:
CentOS yum command
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

proxy=http://mycache.mydomain.com:3128
# Username used for proxy authentication
proxy_username=yum-user 
proxy_password=qwerty
Save and exit config file, now you should be able to install software from the official CentOS repositories.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s