当我尝试运行任何 apt-get 命令时,出现错误::
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
我的第一反应是尝试sudo apt-get install apt-transport-https
,所以我这样做了,但在开始下载后却收到相同的错误消息。所以我检查了本网站上数十个类似的问题,发现大多数都推荐sudo apt-get install apt-transport-https
。因此,为了确保我没有犯一些愚蠢的错误,我再次尝试了此方法,但仍然没有用。
其他人建议检查 sources.list 中的拼写错误,但我发现其中的每个链接上都只有 http://,所以据我所知,这不可能是问题所在。
我在 Docker 容器上运行 Ubuntu 14.04。我也可以 ping 通,所以我不认为这是互联网问题。而且,sources.list.d
是空的。
编辑
跑步sudo apt-get update --print-uris
可得:
'http://archive.ubuntu.com/ubuntu/dists/trusty/main/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty_main_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty_restricted_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty/universe/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty_universe_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty_restricted_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty/universe/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease' archive.ubuntu.com_ubuntu_dists_trusty_InRelease 0
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty-updates_main_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty-updates_restricted_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty-updates_restricted_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease' archive.ubuntu.com_ubuntu_dists_trusty-updates_InRelease 0
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty-security_main_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty-security_restricted_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/source/Sources.gz' archive.ubuntu.com_ubuntu_dists_trusty-security_universe_source_Sources 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty-security_main_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty-security_restricted_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages.gz' archive.ubuntu.com_ubuntu_dists_trusty-security_universe_binary-amd64_Packages 0 :
'http://archive.ubuntu.com/ubuntu/dists/trusty-security/InRelease' archive.ubuntu.com_ubuntu_dists_trusty-security_InRelease 0