如何从dpkg中删除PPA存储库

我是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参考URL:我获取JDK11参考的路径 谢谢。

在解决了这个错误之后,你也可以从 https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html 下载“deb”软件包,而不是使用ppa进行安装。然后,您可以使用 gdebi 安装 deb 文件。 - mchid
2个回答

移除卡住的包裹。
sudo apt remove oracle-java11-installer-local

如果那不起作用,您可以运行:sudo dpkg -P oracle-java11-installer-local尝试手动使用dpkg而不是apt进行卸载。 - mchid
我已经使用了你的解决方案,它运行良好。感谢每一个人。 - Khan Usama

错误提示说你需要下载文件 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