sources.list use proxy

 

Add 25acquire.txt fiel to etc/apt/apt.conf.d/

 

 

25acquireis as follow:

 

 

 

 

// Options for the downloading routines
Acquire
{
  Queue-Mode "host";       // host|access
  Retries "0";
  Source-Symlinks "true";

  // HTTP method configuration
  http
  {
    Proxy " http://172.16.99.131:911";
    Proxy::debian.ustc.edu.cn "DIRECT";  // Specific per-host setting
    Timeout "120";
    Pipeline-Depth "5";

    // Cache Control. Note these do not work with Squid 2.0.2
    No-Cache "false";
    Max-Age "86400";     // 1 Day age on index files
    No-Store "false";    // Prevent the cache from storing archives
//    Dl-Limit "7";        // 7Kb/sec maximum download rate
  };


  // HTTPS method configuration:
  // - uses the http proxy config
  // - uses the http cache-control values
  // - uses the http Dl-Limit values
  https
  {
//        Verify-Peer "false";
//        SslCert "/etc/apt/some.pem";
//        CaPath  "/etc/ssl/certs";
        Verify-Host "2";
  };

  ftp
  {
    Proxy "http://172.16.99.131:911/"; // your proxy
    Proxy::debian.ustc.edu.cn "DIRECT"; // Specific per-host setting

    /* Required script to perform proxy login. This example should work
       for tisfwtk */
//    ProxyLogin
//    {
//       "USER $(PROXY_USER)";
//       "PASS $(PROXY_PASS)";
//       "USER $(SITE_USER)@$(SITE):$(SITE_PORT)";
//       "PASS $(SITE_PASS)";
//    };

    Timeout "120";

    /* Passive mode control, proxy, non-proxy and per-host. Pasv mode
       is prefered if possible */
//    Passive "true";
//    Proxy::Passive "true";
//    Passive::http.us.debian.org "true"; // Specific per-host setting
  };

//  cdrom
//  {
//    mount "/cdrom";

    // You need the trailing slash!
//    "/cdrom/"
//    {
//       Mount "sleep 1000";
//       UMount "sleep 500";
//    }
//  };

//  gpgv
//  {
//   Options {"--ignore-time-conflict";}  // not very usefull on a normal system
//  };

//  mirror
//  {
//   RefreshInterval "360"; // refresh interval in minutes
//   MaxAge "90";           // max age for a mirror file in days before
                          // it gets deleted
   // mirror failure reporting script
//   ProblemReporting "/usr/lib/apt/apt-report-mirror-failure";
   // mirror failure reporting url
//   ReportFailures " http://example.com/mirror-failure";
//  };

  // translations can be set here to "none", "environment" or "$locale"
  Translation "none";
};

你可能感兴趣的:(sources.list use proxy)