|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
Yum works with proxy perfectly well. But you need to to be careful -- setting of environment variable http-proxy should be the same as proxy setting in /etc/yum.conf.
Those guys from RHEL lost all architectural vision and do some really strange and potentially harmful things. For example if you look at /etc/yum.repos.d (which actually should be in yum dorecty if you ask me) you will see that they have proxy setting in redhat.repo file.
If you change your proxy you need to correct this file, which is far from evident.
See for example Managing Software with yum
Using
yum
with a Proxy ServerBy default,
yum
accesses network repositories with HTTP. Allyum
HTTP operations use HTTP/1.1, and are compatible with web proxy servers that support this standard. You may also access FTP repositories, and configureyum
to use an FTP proxy server. Thesquid
package provides a proxy service for both HTTP/1.1 and FTP connections.
! Modifying yum
for Network CompatibilityRefer to the man
page foryum.conf
for information on HTTP settings that may be modified for compatibility with nonstandard web proxy servers. Alternatively, configureyum
to use an FTP proxy server, and access repositories that support FTP. The Fedora repositories support both HTTP and FTP.Configuring Proxy Server Access
To enable all
yum
operations to use a proxy server, specify the proxy server details in/etc/yum.conf
Just setting variables might not be enough
- The
proxy
setting must specify the proxy server as a complete URL, including the TCP port number.- If your proxy server requires a username and password, specify these by adding
proxy_username
andproxy_password
settings.The settings below enable
yum
to use the proxy servermycache.mydomain.com
, connecting to port 3128, with the usernameyum-user
and the passwordqwerty
.# # The proxy server - proxy server:port number # proxy=http://mycache.mydomain.com:3128 # note that port needs to be specified if it is different from the default (80)# The account details for yum connections proxy_username=yum-user proxy_password=qwertyConfiguration File Settings for Using A Proxy Server
! Global Settings If you define a proxy server in /etc/yum.conf
, all users connect to the proxy server with those details when usingyum
.Configuring Proxy Server Access for a Single User
To enable proxy access for a specific user, add the lines in the example box below to the user's shell profile. For the default
bash
shell, the profile is the file~/.bash_profile
. The settings below enableyum
to use the proxy servermycache.mydomain.com
, connecting to port 3128.# The Web proxy server used by this account http_proxy="http://mycache.mydomain.com:3128" export http_proxy
Profile Settings for Using a Proxy Server
If the proxy server requires a username and password, add these to the URL. To include the username
yum-user
and the passwordqwerty
, add these settings:# The Web proxy server, with the username and password for this account http_proxy="http://yum-user:[email protected]:3128" export http_proxy
Profile Settings for a Secured Proxy Server
! The http_proxy
Environment VariableThe http_proxy
environment variable is also used bycurl
and other utilities. Althoughyum
itself may usehttp_proxy
in either upper-case or lower-case,curl
requires the name of the variable to be in lower-case.