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


经过搜索与文档查阅,找到了解决方法:在目录/etc/apt/apt.conf.d下创建文件99FixHashCheckSumError,其中包含如下内容。
Acquire::http::Pipeline-Depth 0;
Acquire::http::No-Cache true;
之后,再运行apt-get或aptitude则一切正常。需要说明的是,虽然网上有人提到还应加入Acquire::BrokenProxy true;,但是该配置选项并未被apt.conf的文档提及。
参考apt.conf的man说明和RFC 2616,以上各配置条目的含义摘录如下:
Acquire::http::Pipeline-Depthcan 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-Cachetells the proxy not to use its cached response under any circumstances.
Apt下载安装包时Hash校验和不符的更多相关文章
- apt 下载安装包
1) Try both without sudo, apt-get download will pass and apt-get -d install will fail (root required ...
- 【Ubuntu】更新系统时出现Hash校验和不符的错误(已解决)
在使用 sudo apt-get update && sudo apt-get upgrade 命令更新系统时出现类似这样的错误信息: W: 无法下载 bzip2:/var/lib/a ...
- CentOS yum安装软件时保留安装包及依赖包或者自动下载安装包及相关依赖包
CentOS上安装某个软件一般都有很多相关的依赖包,当然,这也与我们安装时software selection步骤中选择的版本有关系,我们服务器在安装CentOS时一般选择Basic Web Serv ...
- Python 解决Python安装包时提示Unable to find vcvarsall.bat的问题
解决Python安装包时提示Unable to find vcvarsall.bat的问题 by:授客 QQ:1033553122 问题 Python安装包时,提示Unable to find v ...
- Hadoop学习笔记(一)从官网下载安装包
Hadoop是一个分布式系统基础架构,由Apache基金会所开发.用户可以在不了解分布式底层细节的情况下,开发分布式程序.充分利用集群的威力进行高速运算和存储.要学习Hadoop从下载安装包开始 打开 ...
- 配置Windows Server2008+iis+php+mysql所需下载安装包
最近一个朋友让我帮忙给配置服务器iis+php+mysq 环境,遇到了很多问题,特此就在这里说一下.小弟只是在windwos2003 和windwos XP下配置过iis+php+mysql,去朋友那 ...
- How to: Installshield做安装包时如何添加文件
原文:How to: Installshield做安装包时如何添加文件 我一直以为这不是一个问题,可是没想到在几个群内,对于如何向安装包添加文件不解的大有人在,今日稍暇,整理成篇,以供参考 首先我想再 ...
- Linux(CentOS7)yum安装卸载命令,离线下载安装包
一.Linux版本 二.yum安装 比如安装vim编辑器,y是自动应答,即默认一路确认,不用中途确认 yum install -y vim 三.yum卸载 比如卸载掉刚刚安装的vim yum eras ...
- Yum 下载安装包及对应依赖包
Yum 下载安装包及对应依赖包: 安装该软件:yum install -y yum-plugin-downloadonly 以下载 openssh-server 为例 yum install -y o ...
随机推荐
- 【redis】redis5.0的一些新特性
redis5.0总共增加了12项新特性,如下: 1.新增加的Stream(流)数据类型,这样redis就有了6大数据类型,另外五种是String(字符串),Hash(哈希),List(列表),Set( ...
- Java Web乱码原因与解决
Java Web乱码原因与解决 一.了解编码常识: 1.ASCII 码 众所周知,这是最简单的编码.它总共可以表示128个字符,0~31是控制字符如换行.回车.删 除等,32~126是打印字符,可以通 ...
- VS配置Halcon(一次配置,永久使用)
[说明]只需配置一次,以后新项目无需再次配置. 本教程是64位版本,32位可参考本教程.VS与Halcon无论哪个版本,都可参考本教程. [步骤]以VS2015+Halcon18.11为例 1.新建一 ...
- NFV-Based Scalable Guaranteed-Bandwidth Multicast Service for Software Defined ISP Networks
文章名称:NFV-Based Scalable Guaranteed-Bandwidth Multicast Service for Software Defined ISP Networks 发表时 ...
- Guest Editors’ Introduction: Special Issue on Advances in Management of Softwarized Networks
文章名称:Guest Editors’ Introduction:Special Issue on Advances in Management of Softwarized Networks 发表时 ...
- I2C(四)linux3.4(写代码)
title: I2C(四)linux3.4(写代码) date: 2019/1/29 17:18:42 toc: true --- I2C(四)linux3.4(写代码) 老师的参考代码 https: ...
- 重装了Devexpress后项目报Dll引用找不到问题解决办法
最近将我的开发环境从VS2015升级到VS2017,升级完后报如下错误,找不到Dev的引用,明明是重新装了dev为什么找不到呢? 经过查看dll引用地址,发现我的dev一开始是安装在C盘,dll引用路 ...
- 网络协议 HTTP入门学习
概述 Web 的诞生,源于三大技术的诞生,它们都是当年 Web 之父 Tim Berners-Lee 自己 开发的,世界上第一个网站诞生的时间是 1991 年,三大技术的诞生也就是在此之前的不久: 1 ...
- luogu P5305 [GXOI/GZOI2019]旧词
传送门 先考虑\(k=1\),一个点的深度就是到根节点的路径上的点的个数,所以\(lca(x,y)\)的深度就是\(x\)和\(y\)到根路径的交集路径上的点的个数,那么对于一个询问,我们可以对每个点 ...
- 【2】学习C++之引用
C++中的引用类似于现实生活中人们之间起昵称,昵称和本名都可以辨别人. 1.普通变量的引用: ;//a为本名 int &b=a;//b为a的昵称 其中不能光有昵称没有本名,如果只定义了引用,却 ...