1.首先新建一个bash文件

 

vim /etc/profile.d/proxy.sh

加入以下内容
(有账号密码)
export HTTP_PROXY="http://username:password@192.168.1.1:808/"
export FTP_PROXY="http://username:password@192.168.1.1:808/"
export no_proxy=127.0.0.1,192.168.,localhost
use_proxy=on
(无账号密码)
export HTTP_PROXY="http://192.168.1.1:808/"
export FTP_PROXY="http://192.168.1.1:808/"
export no_proxy=127.0.0.1,192.168.,localhost
use_proxy=on

注: ip和端口自行替换。

保存(新建)退出

 

2.授权(执行权)

chmod +x /etc/profile.d/proxy.sh

3.新建yum.conf

vi /etc/yum.conf
加入
proxy=http://username:password@192.168.1.1:808/
或者
proxy=http://192.168.1.1:808/

重启电脑就使用代理上网了 。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-07-18
  • 2022-02-07
  • 2021-08-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-16
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-06-24
相关资源
相似解决方案