如何正确配置 APT 代理?

如何正确配置 APT 代理?

我正在尝试为 APT 设置代理,以便我可以更新。

服务器位于域中的代理后面。我尝试了以下操作/etc/apt/apt.conf

  1. 适用于 FTP、HTTP、https

    Acquire::HTTP::Proxy "http://[domain\user[:Password02#]@10.1.1.8:8080/";
    
  2. 也尝试过

    Acquire::http::Proxy "http://domain\user:Password02#]@10.1.1.8:8080/";
    
  3. 也尝试过

    Acquire::http::Proxy "http:/[email protected]:Password02#]@10.1.1.8:8080/";
    

我总是收到以下错误:

root@canonical:/etc/apt# apt-get update

  407  Proxy Authorization Required

Reading package lists... Done
W: The repository 'http://security.ubuntu.com/ubuntu xenial-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://za.archive.ubuntu.com/ubuntu xenial Release' does 

我该如何正确设置我的代理?

答案1

Acquire::http::Proxy "http://user:[email protected]:8080";
Acquire::https::Proxy "http://user:[email protected]:8080";
Acquire::ftp::Proxy "http://user:[email protected]:8080";

相关内容