我的 Ubuntu 16.04 系统上有 Java,但每次尝试安装程序/包时都会出现错误:
Do you want to continue? [Y/n] y
Setting up oracle-java8-installer (8u131-1~webupd8~2) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2017-08-14 19:20:07-- http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 188.43.76.48, 188.43.76.74
Connecting to download.oracle.com (download.oracle.com)|188.43.76.48|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2017-08-14 19:20:08 ERROR 403: Forbidden.
download failed
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
我怎样才能解决这个问题?
答案1
谢谢,在网上搜索后我解决了我的问题:
我删除了'ppa:webupda8team/java'apt存储库软件和更新(按下-->超级用户键-->在搜索中输入“软件和更新”-->“其他软件”选项卡-->从列表中删除“ppa:webupda8team/java”
然后我检查了 source.list 文件以删除是否存在任何“ppa:webupda8team/java”,使用以下命令:
sudo nano /etc/apt/source.list
我还检查了 source.list.d 目录以删除 java ppa 文件:
sudo rm -i /etc/apt/source.list.d/webupda8team
然后我使用以下方法更新存储库:
sudo apt-get update
答案2
如果您通过其他方法安装了 Java,并且对 Java 设置感到满意,请删除导致错误的 webupda8 PPA:
sudo add-apt-repository -r ppa:webupd8team/java
然后运行
sudo apt update