Saya masih memiliki masalah yang sama. Tak satu pun dari jawaban di atas tampaknya menyelesaikannya. Saya memiliki ubuntu 16.04, dan saya mengikuti langkah-langkah yang dijelaskan di https://docs.docker.com/install/linux/docker-ce/ubuntu/
Saya curiga ini terkait dengan apt-get
bug terkait https. Informasi yang dicetak apt-get
agak menyesatkan.
Saya pikir itu Failed to fetch..
juga bisa diterjemahkan sebagai:problem accessing resource from within an https connection
Bagaimana saya sampai pada kesimpulan ini:
Pertama-tama saya berada di belakang proxy perusahaan jadi saya telah menetapkan konfigurasi berikut:
/etc/apt/apt.conf
Acquire::http::proxy "http://squidproxy:8080/";
Acquire::https::proxy "http://squidproxy:8080/";
Acquire::ftp::proxy "ftp://squidproxy:8080/";
Acquire::https::CaInfo "/etc/ssl/certs/ca-certificates.pem";
/etc/apt/apt.conf.d/99proxy
Acquire::http::Proxy {
localhost DIRECT;
localhost:9020 DIRECT;
localhost:9021 DIRECT;
};
Saya melakukan tes berikut dengan entri yang berbeda di sources.list
entri tes 1:
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
sudo apt-get update
W: The repository 'https://download.docker.com/linux/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/stable/binary-amd64/Packages
E: Some index files failed to download. They have been ignored, or old ones used instead.
Kegagalan
entri tes 2:
deb [arch=amd64] http://localhost:9020/linux/ubuntu xenial stable
/etc/apache2/sites-enabled/apt-proxy.conf
# http to https reverse proxy configuration.
Listen 9020
<VirtualHost *:9020>
SSLProxyEngine On
# pass from squid proxy
ProxyRemote https://download.docker.com/ http://squidproxy:8080
ProxyPass / https://download.docker.com/
ProxyPassReverse / https://download.docker.com/
ErrorLog ${APACHE_LOG_DIR}/apt-proxy-error.log
CustomLog ${APACHE_LOG_DIR}/apt-proxy-access.log combined
</VirtualHost>
sudo apt-get update
Hit:1 ..
Hit:2 ..
...
Hit:7 http://localhost:9020/linux/ubuntu xenial InRelease
Get:8 ...
Fetched 323 kB in 0s (419 kB/s)
Reading package lists... Done
Keberhasilan
entri tes 3:
deb [arch=amd64] https://localhost:9021/linux/ubuntu xenial stable
/etc/apache2/sites-enabled/apt-proxy.conf
# https to https revere proxy
Listen 9021
<VirtualHost *:9021>
# serve on https
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLProxyEngine On
# pass from squid proxy
ProxyRemote https://download.docker.com/ http://squidproxy:8080
ProxyPass / https://download.docker.com/
ProxyPassReverse / https://download.docker.com/
ErrorLog ${APACHE_LOG_DIR}/apt-proxy-error.log
CustomLog ${APACHE_LOG_DIR}/apt-proxy-access.log combined
</VirtualHost>
sudo apt-get update
W: The repository 'https://localhost:9021/linux/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://localhost:9021/linux/ubuntu/dists/xenial/stable/binary-amd64/Packages
E: Some index files failed to download. They have been ignored, or old ones used instead.
Kegagalan
Dalam kasus di atas, url yang apt-get Failed to fetch
dan juga Release
file tersebut, sebenarnya dapat diakses dari browser
/ wget
/ curl
menggunakan konfigurasi proxy yang sama.
Fakta yang apt-get
bekerja hanya dengan http reverse proxy url, menyiratkan bahwa ada beberapa masalah dalam mengakses sumber daya dari dalam koneksi https .
Saya tidak tahu apa masalah ini tetapi apt-get
harus menunjukkan pesan yang lebih informatif ( apt
bahkan kurang bertele-tele).
Catatan: kasus wiresharking 1 menunjukkan bahwa proxy CONNECT
berhasil, dan tidak ada RST yang dikirim, tetapi tentu saja file tidak dapat dibaca.