*以下设置适用于Ubuntu 20.04系统
1. 打开apt设置文件所在的文件夹
cd /etc/apt/apt.conf.d/
2. 在该文件夹下新建一个名为proxy.conf的文件
vi proxy.conf
3. 在文件中写入以下内容
Acquire::http::Proxy "http://proxyaddress:proxyport";
Acquire::https::Proxy "https://proxyaddress:proxyport";
其中,"proxyaddress"为代理服务器的地址,"proxyport"为代理服务器的端口。如果代理服务器地址为127.0.0.1,端口为7890,则文件内容应配置如下:
Acquire::http::Proxy "http://127.0.0.1:7890/";
Acquire::https::Proxy "https://127.0.0.1:7890/";
如果代理服务器需要用户名和密码登录,则将以上内容替换为:
Acquire::http::Proxy "http://username:password@proxyaddress:proxyport";
Acquire::https::Proxy "https://username:password@proxyaddress:proxyport";
其中,"username"为用户名,"password"密码。
在Ubuntu 20.04系统中配置apt代理,包括创建proxy.conf文件,填入代理服务器地址和端口,支持匿名登录。详细步骤包括打开apt配置文件夹,新建proxy.conf,输入Acquire::http和Acquire::https的代理设置,如果需要认证则加入用户名和密码。
2003





