How to run yum behind a proxy sever
Configuring yum to run behind a proxy server is easy. You need to create an environment variable “http_proxy”. Yum will read it everytime it loads and run without any trouble.
Open the file /etc/profile.d/proxy.sh. If this file doesn't exist then create one. You have to be root to do these changes.
[jasonleon]$ vi /etc/profile.d/proxy.sh
and add the following line
export http_proxy=http://proxy:port/
where,
proxy is your proxy server (like 192.168.36.1)
port is the port number
Now, run this command(do this as root)
[jasonleon]$ sh /etc/profile.d/proxy.sh
If yum is still not working then logout and login again, yum will start working.
This will add the setting for all users of the system. If a user wants to override this variable then the same line can be added in the file .bash_profile present in the home directory of the user. If the file is not present then create one.



























3 Comments
Post new comment