每次我尝试使用以下命令在 Ubuntu 18.04(在 VirtualBox VM 上)上安装 java(我已经尝试了其他主题/论坛中的其他几个命令/方法):
sudo apt install default-jdk
无论我做什么,当需要检索标头时,我都会收到以下错误:
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 http://au.archive.ubuntu.com/ubuntu bionic InRelease
Connection failed [IP: 202.158.214.106 80]
Err:3 http://au.archive.ubuntu.com/ubuntu bionic InRelease
Connection failed [IP: 202.158.214.106 80]
Err:4 http://au.archive.ubuntu.com/ubuntu bionic InRelease
Connection failed [IP: 202.158.214.106 80]
Reading package lists... Done
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/bionic/InRelease
Connection failed [IP: 202.158.214.106 80]
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease
Connection failed [IP: 202.158.214.106 80]
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease
Connection failed [IP: 202.158.214.106 80]
W: Some index files failed to download. They have been ignored, or old ones used instead
答案1
似乎无法连接到这些存储库,或者它们不再可用。
抱歉,但是,只是为了检查一下。您可以在此 VirtualBox 操作系统中访问互联网吗?然后,了解如何更改 Ubuntu 18.04 的存储库源。
我没有准确回答,因为我已经很长时间没有使用Ubuntu了,但我发现了这个:
^https://help.ubuntu.com/community/Repositories/Ubuntu#Adding%20Canonical%20Partner%20Repositories
²http://www.ubuntubuzz.com/2018/03/how-to-change-ubuntu-repository-mirror-sources.html