ubuntu代理配置问题

ubuntu代理配置问题

在公司使用ubuntu系统时,因为公司上网需要代理,因此需要为每一个用到的工具配置代理

wget配置:

编辑wgetrc文件:

sudo gedit /etc/wgetrc 

根据自己公司的代理地址、账号密码改写http_proxy部分。(一开始我的密码有@字符,不知道怎么解决就改密码了)。然后use_proxy选择on。

# 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://id:password@ip:port/
http_proxy = http://id:password@ip:port/
ftp_proxy = http://id:password@ip:port/

# If you do not want to use proxy at all, set this to off.
use_proxy = on

apt配置

网上关于apt代理配置的教程比较多,但不知道为什么大部分方法在我的电脑上都不好用。最后成功的方法是;

sudo gedit /etc/apt/apt.conf

添加内容:

Acquire::http::proxy "http://id:password@ip:port/";
Acquire::ftp::proxy "http://id:password@ip:port/";
Acquire::https::proxy "http://id:password@ip:port/";

同样,根据自己的账户密码改写其中的代理。

猜你喜欢

转载自blog.csdn.net/weixin_39952791/article/details/84281866