
apt-getを使おうとしているAcquire::By-Hash option
そのため、パッケージ バージョンではなく、暗号ハッシュでパッケージを識別してダウンロードします。これにより、apt-get install を試行しているときに競合状態や「ハッシュ サムの不一致」エラーが発生するのを防ぐことができます。
apt-getでこの方法を使うことはできません。試してみました
- パッティング
Acquire::By-Hash "force";
/etc/apt/apt.conf.d/51acquire_by_hash
- ソースリストの変更:
deb [by-hash=force] http://ftp.us.debian.org/debian/ buster main contrib non-free
- apt-get オプションを使用する
-o Acquire::by-hash=force
どちらも機能しません。apt-get は依然として古い方法を使用します (要求している URL を参照してください)
# 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 (1.8.2.1)
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) ...
ミラーは By-Hash をサポートします:
$ wget http://ftp.us.debian.org/debian/dists/buster/InRelease 2>/dev/null -O - | grep By-Hash
Acquire-By-Hash: yes
apt-get でそのオプションを使用する方法について何かアイデアはありますか? ありがとうございます。
答え1
マニュアルapt.conf(5)と述べていますAcquire::By-Hash
。
ダウンロードしてみるインデックス予想されるファイルのハッシュサムから構築されたURIを介して
(強調は筆者)
私のテストでは、以下は期待通りに動作しました ( をクリーンアップした後ですが/var/lib/apt/lists
、これはapt clean
あまりうまく機能していないようです)。ローカル ミラーがあるため、そのログから要求されたインデックスも確認できました。
apt{,-get} update -o Acquire::By-Hash="force" -o Debug::Acquire::http=true
したがって、マニュアルは正確で正確です。ハッシュによるパッケージ自体の取得はサポートされておらず、インデックスのみがサポートされています。