Java OpenJDK 安装不起作用

Java OpenJDK 安装不起作用

我最近在 Windows 上安装了 Ubuntu,所以我完全是新手。我在 Windows 机器上用 Java 编码,但现在想在 Ubuntu 上写。但是,当尝试按照教程(例如如何安装 Java?)我的终端出现错误,我将在这里添加。

milan@milan-Inspiron-7559:~$ sudo apt-get install default-jre
[sudo] password for milan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ca-certificates-java default-jre-headless fonts-dejavu-extra java-common
  libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jre
  openjdk-11-jre-headless
Suggested packages:
  fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
  | fonts-wqy-zenhei
The following NEW packages will be installed:
  ca-certificates-java default-jre default-jre-headless fonts-dejavu-extra
  java-common libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jre
  openjdk-11-jre-headless
0 upgraded, 9 newly installed, 0 to remove and 7 not upgraded.
Need to get 37.5 MB/39.5 MB of archives.
After this operation, 178 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Ign:1 http://za.archive.ubuntu.com/ubuntu eoan-updates/main amd64 openjdk-11-jre-headless amd64 11.0.7+10-2ubuntu2~19.10
Ign:2 http://za.archive.ubuntu.com/ubuntu eoan-updates/main amd64 openjdk-11-jre amd64 11.0.7+10-2ubuntu2~19.10
Ign:3 http://za.archive.ubuntu.com/ubuntu eoan/main amd64 libatk-wrapper-java all 0.35.0-3
Err:4 http://za.archive.ubuntu.com/ubuntu eoan/main amd64 libatk-wrapper-java-jni amd64 0.35.0-3
  404  Not Found [IP: 197.155.77.2 80]
Err:3 http://za.archive.ubuntu.com/ubuntu eoan/main amd64 libatk-wrapper-java all 0.35.0-3
  404  Not Found [IP: 197.155.77.2 80]
Err:1 http://security.ubuntu.com/ubuntu eoan-updates/main amd64 openjdk-11-jre-headless amd64 11.0.7+10-2ubuntu2~19.10
  404  Not Found [IP: 197.155.77.2 80]
Err:2 http://security.ubuntu.com/ubuntu eoan-updates/main amd64 openjdk-11-jre amd64 11.0.7+10-2ubuntu2~19.10
  404  Not Found [IP: 197.155.77.2 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-lts/openjdk-11-jre-headless_11.0.7+10-2ubuntu2~19.10_amd64.deb  404  Not Found [IP: 197.155.77.2 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-lts/openjdk-11-jre_11.0.7+10-2ubuntu2~19.10_amd64.deb  404  Not Found [IP: 197.155.77.2 80]
E: Failed to fetch http://za.archive.ubuntu.com/ubuntu/pool/main/j/java-atk-wrapper/libatk-wrapper-java_0.35.0-3_all.deb  404  Not Found [IP: 197.155.77.2 80]
E: Failed to fetch http://za.archive.ubuntu.com/ubuntu/pool/main/j/java-atk-wrapper/libatk-wrapper-java-jni_0.35.0-3_amd64.deb  404  Not Found [IP: 197.155.77.2 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
milan@milan-Inspiron-7559:~$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

我将不胜感激任何帮助。

答案1

升级到 Ubuntu 20.04 LTS 解决了这个问题。

相关内容