wget\yum配置代理模式

来源:互联网 发布:招聘淘宝客服 编辑:程序博客网 时间:2024/05/01 19:01

前言:

[root@minimal ~]# cat /etc/redhat-releaseCentOS Linux release 7.3.1611 (Core)

众所周知,由于某些原因,国内访问很多外网速度奇慢,导致我们在安装软件的时候很慢很慢,这个时候,我们可以使用代理来解决这个问题:
注意:优先使用国内yum源!参考链接:
好了,来说说配置代理的事情:

一.系统全局的代理设置;

用vi/vim编辑器打开/etc/profile,追加如下内容:

http_proxy=http://192.168.1.100:1080ftp_proxy=http://192.168.1.100:1080export http_proxyexport ftp_proxy

如果需要输入账号和密码,则追加的内容如下:

http_proxy=http://username:passwd@192.168.1.100:1080ftp_proxy=http://username:passwd@192.168.1.100:1080export http_proxyexport ftp_proxy

另外,如果不想做全局配置,只为某一用户配置,例如root,则可以将上述内容之一配置追加到/root/.bash_profile

二.yum的代理设置;

用vi/vim编辑器打开/etc/yum.conf,追加如下内容:

http_proxy=http://192.168.1.100:1080ftp_proxy=http://192.168.1.100:1080
或者:
http_proxy=http://192.168.1.100:1080ftp_proxy=http://192.168.1.100:1080proxy_username=usernameproxy_password=password

另外,ubuntu的OS apt-get代理联网设置可以用如下方法:

echo ‘Acquire::http::proxy “http://192.168.1.100:1080;’ > /etc/apt/apt.conf

三.wget的代理设置;

用vi/vim编辑器打开/etc/wgetrc,找到代理设置所在行,然后追加如下内容:

# You can set the default proxies for Wget to use for http, https, and ftp.# They will override the value in the environment.#https_proxy = http://proxy.yoyodyne.com:18023/#http_proxy = http://proxy.yoyodyne.com:18023/#ftp_proxy = http://proxy.yoyodyne.com:18023/http_proxy=http://192.168.1.100:1080/ftp_proxy=http://192.168.1.100:1080/

前言:

[root@minimal ~]# cat /etc/redhat-releaseCentOS Linux release 7.3.1611 (Core)

众所周知,由于某些原因,国内访问很多外网速度奇慢,导致我们在安装软件的时候很慢很慢,这个时候,我们可以使用代理来解决这个问题:
注意:优先使用国内yum源!参考链接:
好了,来说说配置代理的事情:

一.系统全局的代理设置;

用vi/vim编辑器打开/etc/profile,追加如下内容:

http_proxy=http://192.168.1.100:1080ftp_proxy=http://192.168.1.100:1080export http_proxyexport ftp_proxy

如果需要输入账号和密码,则追加的内容如下:

http_proxy=http://username:passwd@192.168.1.100:1080ftp_proxy=http://username:passwd@192.168.1.100:1080export http_proxyexport ftp_proxy

另外,如果不想做全局配置,只为某一用户配置,例如root,则可以将上述内容之一配置追加到/root/.bash_profile

二.yum的代理设置;

用vi/vim编辑器打开/etc/yum.conf,追加如下内容:

http_proxy=http://192.168.1.100:1080ftp_proxy=http://192.168.1.100:1080
或者:
http_proxy=http://192.168.1.100:1080ftp_proxy=http://192.168.1.100:1080proxy_username=usernameproxy_password=password

另外,ubuntu的OS apt-get代理联网设置可以用如下方法:

echo ‘Acquire::http::proxy “http://192.168.1.100:1080;’ > /etc/apt/apt.conf

三.wget的代理设置;

用vi/vim编辑器打开/etc/wgetrc,找到代理设置所在行,然后追加如下内容:

# You can set the default proxies for Wget to use for http, https, and ftp.# They will override the value in the environment.#https_proxy = http://proxy.yoyodyne.com:18023/#http_proxy = http://proxy.yoyodyne.com:18023/#ftp_proxy = http://proxy.yoyodyne.com:18023/http_proxy=http://192.168.1.100:1080/ftp_proxy=http://192.168.1.100:1080/

四、设置firefox上网代理:

设置路径,Edit–> Preferences–>Advanced–>Network–>Settings.

测试一下:
这里写图片描述

速度杠杠的!如果需要像我这样的VPN,可以留言哦。