新浪博客

Centos代理上网

2022-09-16 11:14阅读:

有些时候软件的相关依赖必须要国外的网络才能下载,这就用到了代理上网

1、yum代理设置

编辑文件为:/etc/yum.conf

在里面添加这一行:proxy=IP:PORT

例子:

porxy=http://192.168.250.250:8015

2、wget代理设置


编辑文件为:/etc/wgetrc

添加

下面两行:

http_proxy = IP:PORT

ftp_proxy = IP:PORT


3、系统环境代理设置


编辑文件为/etc/profile,如果只想给自己的账户设置,则编辑~/.bashrc即可


添加三行:


# add proxy for network


export http_proxy=http://child-prc.intel.com:913


export https_proxy=http://child-prc.intel.com:913


export ftp_proxy=$http_proxy


然后source /etc/profile 即可


4、curl代理设置


编辑 ~/.bashrc


alias curl = 'curl -x IP:Port '

————————————————

版权声明:本文为CSDN博主「想见感」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/weixin_42763067/article/details/124675432

我的更多文章

下载客户端阅读体验更佳

APP专享