Fedora设置代理服务器
#vim /etc/profile.d/proxy.sh
代理没有密码的情况,在文件中添加
export http_proxy=“http://SERVER:PORT/”
export https_proxy=“http://SERVER:PORT/”
export ftp_proxy=“http://SERVER:PORT/”
export no_proxy=“127.0.0.1,localhost”
代理有密码的情况,在文件中添加
export http_proxy=“http://UserName:PSWD@SERVER:PORT/”
export https_proxy=“http://UserName:PSWD@SERVER:PORT/”
export ftp_proxy=“http://UserName:PSWD@SERVER:PORT/”
export no_proxy=“127.0.0.1,localhost”
如果名字中或密码中有特殊字符!@#$等,用ASCII码代替%XX
~ : 0x7E ! : 0x21 @ : 0x40 # : 0x23 $ : 0x24 % : 0x25 ^ : 0x5E & : 0x26
* : 0x2A ? : 0x3F
例如!@#$可以写为%21%40%23%24
Fedora dnf设置proxy
#vi /etc/dnf/dnf.conf
proxy=http://SERVER:PORT
proxy_username=xxx
proxy_password=xxx