CentOS5.6环境下设置yum代理
学校环境下上网需要设置代理服务器。所以新安装的CentOS无法使用yum和wget等进行操作。现把自己的配置设置显示如下:
网络上面的英文的配置资料如下:
Using yum with a proxy server---------------------------------------
To enable yum operations to use a proxy server you should first add the following parameter to /etc/yum.conf 这个是配置代理网络之后的yum的设定
proxy=http://yourproxy:8080/
编辑/etc/yum.conf文件
这个是我们我的具体的代理的设定:在yum.conf文件的最后一行添加如下所示:
有#的是注释行 起说明作用 方便我们自己了解这行的作用
where yourproxy is the name of the proxy server you want to access and 8080 is the proxy port. If the server requires authentication you can specify the login credentials like:
proxy=http://username:password@yourproxy:8080/
---------------------------------------
The rpm package manager makes use of the proxy environment variable. This can be set system wide in /etc/profile or user specific in ~/.bash_profile::
export http_proxy=http://yourproxy:8080/
export ftp_proxy=http://yourproxy:8080/
---------------------------------------
To use wget throug a proxy server add the following lines to /etc/wgetrc 这个是配置代理网络之后的wget的设定
http_proxy = http://yourproxy:8080/
ftp_proxy = http://yourproxy:8080/