zoukankan      html  css  js  c++  java
  • Apt下载安装包时Hash校验和不符

    近期我的电脑在使用apt-getaptitude下载Linux安装包时总是出现如下图所示的Hash校验和不符的问题。以至于下载过程被频繁中断,不得不反复运行apt-get或者在aptitude中按g键,才能够断点续传,完成全部的下载,非常讨厌。而若令电脑连接手机热点,则没有这样的问题。对此,初步判断是由网络服务提供商代理服务器的配置问题所导致的。

    经过搜索与文档查阅,找到了解决方法:在目录/etc/apt/apt.conf.d下创建文件99FixHashCheckSumError,其中包含如下内容。

     Acquire::http::Pipeline-Depth 0;
     Acquire::http::No-Cache true;

    之后,再运行apt-getaptitude则一切正常。需要说明的是,虽然网上有人提到还应加入Acquire::BrokenProxy true;,但是该配置选项并未被apt.conf的文档提及。

    参考apt.confman说明和RFC 2616,以上各配置条目的含义摘录如下:

    • Acquire::http::Pipeline-Depth can be used to enable HTTP pipelining (RFC 2616 section 8.1.2.2) which can be beneficial e.g. on high-latency connections. It specifies how many requests are sent in a pipeline. APT tries to detect and workaround misbehaving webservers and proxies at runtime, but if you know that yours does not conform to the HTTP/1.1 specification pipelining can be disabled by setting the value to 0. It is enabled by default with the value 10.

      RFC 2616 8.1.2.2 Pipelining

      A client that supports persistent connections MAY "pipeline" its requests (i.e., send multiple requests without waiting for each response). A server MUST send its responses to those requests in the same order that the requests were received.

      Clients which assume persistent connections and pipeline immediately after connection establishment SHOULD be prepared to retry their connection if the first pipelined attempt fails. If a client does such a retry, it MUST NOT pipeline before it knows the connection is persistent. Clients MUST also be prepared to resend their requests if the server closes the connection before sending all of the corresponding responses.

      Clients SHOULD NOT pipeline requests using non-idempotent methods or non-idempotent sequences of methods (see section 9.1.2). Otherwise, a premature termination of the transport connection could lead to indeterminate results. A client wishing to send a non-idempotent request SHOULD wait to send that request until it has received the response status for the previous request.

    • Acquire::http::No-Cache tells the proxy not to use its cached response under any circumstances.

  • 相关阅读:
    删除代码中的空行
    Amazon Payment Amazon Flexible Payments Service (Amazon FPS) 示例代码的一个bug提醒
    一个关于SqlServer 中根据概率获取数据的sql 写法
    linq 排序 List<T>类型数据
    OpenSmtp附件中文名显示问题
    体积网格生成浏览器
    有关Lemek's algo中,除了Initial Ray外Second Ray是不可能出现(W0,W1,W2,。。。Z0均严格>0)的证明
    Shape Match 的方法效果极差 气死我了
    所谓“中国学生数学NB”的神话
    基于tetrahedron的柔体
  • 原文地址:https://www.cnblogs.com/quantumman/p/10704617.html
Copyright © 2011-2022 走看看