I'm trying to make apt-get use
Acquire::By-Hash option, so it will download packages identifying them by cryptographic hash, not by package version. This should prevent race conditions and "Hash Sum Mismatch" errors happening sometimes while trying to apt-get install something.
I can't make apt-get use this method. I tried
- Changing sources.list:
deb [by-hash=force] http://ftp.us.debian.org/debian/ buster main contrib non-free
-o Acquire::by-hash=forceapt-get option Neither works. apt-get still uses the old method (see the URLs it's requesting)
# apt-get -o Acquire::by-hash=force -o Debug::Acquire::http=true install fortunes Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: fortunes 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 1,117 kB of archives. After this operation, 2,611 kB of additional disk space will be used. 0% [Working]GET /debian/pool/main/f/fortune-mod/fortunes_1.99.1-7_all.deb HTTP/1.1 Host: ftp.us.debian.org User-Agent: Debian APT-HTTP/1.3 (184.108.40.206) 0% [Waiting for headers]Answer for: http://ftp.us.debian.org/debian/pool/main/f/fortune-mod/fortunes_1.99.1-7_all.deb HTTP/1.1 200 OK Date: Sun, 09 Aug 2020 05:28:00 GMT Server: Apache Last-Modified: Thu, 15 Aug 2013 03:54:21 GMT ETag: "110cf4-4e3f46de0807d" Accept-Ranges: bytes Content-Length: 1117428 Get:1 http://ftp.us.debian.org/debian buster/main amd64 fortunes all 1:1.99.1-7 [1,117 kB] Fetched 1,117 kB in 18s (60.6 kB/s) Selecting previously unselected package fortunes. (Reading database ... 159825 files and directories currently installed.) Preparing to unpack .../fortunes_1%3a1.99.1-7_all.deb ... Unpacking fortunes (1:1.99.1-7) ... Setting up fortunes (1:1.99.1-7) ...
The mirror supports By-Hash:
$ wget http://ftp.us.debian.org/debian/dists/buster/InRelease 2>/dev/null -O - | grep By-Hash Acquire-By-Hash: yes
Any ideas how to make apt-get use that options? Thank you.