返回

linux 6.5 杂集

发布时间:2022-11-27 01:52:02 245
# 服务器# 服务器

yum 设置代理

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/​​

In both cases, login information can be set like in the example above.

 

特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像
精选文章
thumb 中国研究员首次曝光美国国安局顶级后门—“方程式组织”
thumb 俄乌线上战争,网络攻击弥漫着数字硝烟
thumb 从网络安全角度了解俄罗斯入侵乌克兰的相关事件时间线