我是 Linux 的新用户,目前在配备 AMD 处理器的 HP 笔记本电脑上使用 18.04。前段时间,我尝试从这个存储库安装 JDK11,sudo add-apt-repository ppa:linuxuprising/java
最后sudo apt-get update
按下这个命令,sudo apt-get install oracle-java11-installer-local
执行完后出现错误“软件包未安装”,好吧,我关闭了终端,然后昨天我要安装,sudo apt install ubuntu-restricted-extras
但每次使用时都会出现此错误sudo apt update / sudo apt upgrade
我每次都会遇到的错误:
aus@aus-pc:~$ sudo apt install ubuntu-restricted-extras
[sudo] password for aus:
Reading package lists... Done
Building dependency tree
Reading state information... Done
ubuntu-restricted-extras is already the newest version (66).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up oracle-java11-installer-local (11.0.4-1~linuxuprising1) ...
Before installing this package,
please download the Oracle JDK 11 .tar.gz file
with the same version as this package (version 11.0.4),
and place it in /var/cache/oracle-jdk11-installer-local,
E.g.:
sudo mkdir -p /var/cache/oracle-jdk11-installer-local
sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
sha256sum mismatch jdk-11.0.4_linux-x64_bin.tar.gz
Oracle JDK 11 is NOT installed.
dpkg: error processing package oracle-java11-installer-local (--configure):
installed oracle-java11-installer-local package post-installation script
subprocess returned error exit status 1
Errors were encountered while processing:
oracle-java11-installer-local
E: Sub-process /usr/bin/dpkg returned an error code (1)
注意:我已手动删除了 URL软件和更新中心但我每次都出现这个错误,请帮助我。PPA 参考网址:我从 JDK11 的引用中获取的路径
谢谢
答案1
删除卡住的包:
sudo apt remove oracle-java11-installer-local
答案2
错误提示您需要下载文件jdk-11.0.4_linux-x64_bin.tar.gz
。您可以下载文件从这里。您必须单击接受许可协议,然后才能单击下载文件。
假设文件已下载到您的~/Downloads
目录,请运行以下命令:
cd ~/Downloads
sudo mkdir -p /var/cache/oracle-jdk11-installer-local
sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
sudo dpkg --configure -a