apt-getまたはaptにhttps接続のみを使用させるにはどうすればよいですか?

apt-getまたはaptにhttps接続のみを使用させるにはどうすればよいですか?

httpsを使用してネットワーク上でmongo db dockerコンテナのみを実行します。コンテナは apt-get を使用してパッケージをインストールします。ネットワークはhttps接続のみを許可するため、apt-getは機能しません。 apt-transport-httpsをインストールした後、/etc/apt/sources.listと/etc/apt/sources.list.dでhttpをhttpsに変更してみました。しかし、私には何も効果がありません。 httpsをhttpsに変更した後の/etc/apt/sources.listです。

deb https://deb.debian.org/debian jessie main
deb https://security.debian.org/debian-security jessie/updates main
deb https://deb.debian.org/debian jessie-updates main

/etc/apt/sources.list.d の mongodb-org.list ファイルは次のとおりです。

deb https://repo.mongodb.org/apt/debian jessie/mongodb-org/3.2 main

これらすべてのapt-getアップデートを実行した後、次のように表示されます。

Get:1 https://repo.mongodb.org jessie/mongodb-org/3.2 InRelease [384 B]
Ign https://repo.mongodb.org jessie/mongodb-org/3.2 InRelease
Get:2 https://repo.mongodb.org jessie/mongodb-org/3.2 Release.gpg [801 B]
Hit https://repo.mongodb.org jessie/mongodb-org/3.2 Release
Get:3 https://deb.debian.org jessie InRelease [309 B]
Ign https://deb.debian.org jessie InRelease
Hit https://deb.debian.org jessie-updates InRelease
Ign https://security.debian.org jessie/updates InRelease
Ign https://repo.mongodb.org jessie/mongodb-org/3.2 Release
Get:4 https://repo.mongodb.org jessie/mongodb-org/3.2/main amd64 Packages [10.6 kB]
Hit https://deb.debian.org jessie Release.gpg
Ign https://security.debian.org jessie/updates Release.gpg
Ign https://security.debian.org jessie/updates Release
Get:5 https://deb.debian.org jessie-updates/main amd64 Packages [337 B]
Err https://security.debian.org jessie/updates/main amd64 Packages

Hit https://deb.debian.org jessie Release
Err https://security.debian.org jessie/updates/main amd64 Packages

Err https://security.debian.org jessie/updates/main amd64 Packages

Get:6 https://deb.debian.org jessie/main amd64 Packages [329 B]
Err https://security.debian.org jessie/updates/main amd64 Packages

Err https://security.debian.org jessie/updates/main amd64 Packages
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Fetched 9110 kB in 8s (1096 kB/s)
W: GPG error: https://repo.mongodb.org jessie/mongodb-org/3.2 Release: The following signatures were invalid: KEYEXPIRED 1570654450
W: Size of file /var/lib/apt/lists/partial/deb.debian.org_debian_dists_jessie-updates_main_binary-amd64_Packages.gz is not what the server reported 20 337
W: Failed to fetch https://security.debian.org/debian-security/dists/jessie/updates/main/binary-amd64/Packages  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

E: Some index files failed to download. They have been ignored, or old ones used instead.

ベストアンサー1

後述のhttps接続からセキュリティ更新プログラムを取得することはできません。Debian

現在、ホストにはsecurity.debian.orgHTTPSを介して公的に検証可能なSSL証明書がないため、現在ではHTTPSと一緒に使用することはできません。

/etc/apt/sources.list次のように編集できます。

deb https://deb.debian.org/debian jessie main
deb http://security.debian.org/debian-security jessie/updates main
deb https://deb.debian.org/debian jessie-updates main

MongoDBのgpgキーエラーを解決するには、gpgキーを更新する必要があります。パッケージ管理システムで使用される公開鍵のインポート:

wget -qO - https://www.mongodb.org/static/pgp/server-3.2.asc | sudo apt-key add -

おすすめ記事