dakewei

1.为wget使用代理,可以直接修改/etc/wgetrc,也可以在主文件夹下新建.wgetrc,并编辑相应内容,本文采用后者。

直接往~/.wgetrc(自行创建此文件)添加如下内容:

https_proxy = http://127.0.0.1:8087/
http_proxy = http://127.0.0.1:8087/
ftp_proxy = http://127.0.0.1:8087/
use_proxy = on

这样设置就可以了。

注意:如果不想使用代理了就将~/.wgetrc中的最后一行use_proxy = on改为 use_proxy = off即可.

 

2.为apt-get 使用代理

2.1安装tsocks

sudo apt-get install tsocks

2.2设置tsocks的配置文件

vi /etc/tsocks.conf

往其中加入如下内容:

 server = 127.0.0.1

 server_type = 5

 server_port = 8087

 

3.使用tsocks

在要使用的软件前面加上tsocks即可,比如:

sudo tsocks apt-get update

 

分类:

技术点:

相关文章:

  • 2021-11-09
  • 2021-11-29
  • 2021-10-15
  • 2022-01-29
  • 2022-12-23
  • 2021-06-07
  • 2022-01-21
猜你喜欢
  • 2021-10-01
  • 2022-12-23
  • 2021-12-16
  • 2022-01-09
  • 2021-11-23
  • 2022-12-23
  • 2021-04-06
相关资源
相似解决方案