wget\yum配置代理模式

前言:

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

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

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

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

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

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

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

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

二.yum的代理设置;

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

http_proxy=http://192.168.1.100:1080
ftp_proxy=http://192.168.1.100:1080
或者:
http_proxy=http://192.168.1.100:1080
ftp_proxy=http://192.168.1.100:1080
proxy_username=username
proxy_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.

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

速度杠杠的!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
配置CentOS 7的yum源时,如果没有wget命令,你可以使用curl命令来下载所需的yum源文件。以下是使用curl命令下载阿里云的yum源文件的示例: ``` curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo ``` 这将从阿里云的镜像站点下载CentOS 7的yum源文件,并保存到/etc/yum.repos.d/CentOS-Base.repo路径下。你可以根据需要修改文件名和路径。 请注意,使用curl命令下载文件时,需要确保你的系统已经安装了curl工具。如果没有安装,可以使用以下命令进行安装: ``` yum install curl ``` 这样就可以使用curl命令来下载yum源文件了。 #### 引用[.reference_title] - *1* [CentOS7配置yum源](https://blog.csdn.net/l876460925/article/details/127411727)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [虚拟机给Centos7配置yum源(本地yum和网络yum)](https://blog.csdn.net/LShuo666/article/details/129021403)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SHUIPING_YANG

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值