sources.list use proxy

本文介绍了一个详细的APT配置文件示例,展示了如何通过设置代理、超时限制和其他参数来优化Debian系统的软件包管理器APT。这包括HTTP、HTTPS及FTP等不同协议的配置细节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

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";
};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值