无法使用 sudo apt-get 安装任何东西

无法使用 sudo apt-get 安装任何东西

我很长时间都遇到这个错误,但一直找不到解决办法。每当我尝试使用

$ sudo apt-get install <package>
Setting up oracle-java8-installer (8u111+8u111arm-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc Downloading Oracle Java 8...
--2018-02-09 17:00:08--  http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz Resolving download.oracle.com (download.oracle.com)... 106.51.144.109 Connecting to download.oracle.com (download.oracle.com)|106.51.144.109|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz [following]
--2018-02-09 17:00:08--  https://edelivery.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)...
104.122.10.148, 2600:140f:c000:189::2d3e, 2600:140f:c000:187::2d3e Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.122.10.148|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz?AuthParam=1518175928_00ed0e25d1821b70eb9e792e6c25a9bf [following]
--2018-02-09 17:00:08--  http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz?AuthParam=1518175928_00ed0e25d1821b70eb9e792e6c25a9bf Connecting to download.oracle.com (download.oracle.com)|106.51.144.109|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2018-02-09 17:00:08 ERROR 404: Not Found.

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 dpkg: dependency problems prevent configuration of oracle-java8-set-default:  oracle-java8-set-default depends on oracle-java8-installer; however:   Package oracle-java8-installer is not configured yet.

    dpkg: error processing package oracle-java8-set-default (--configure): dependency problems - leaving unconfigured Errors were encountered while processing:  oracle-java8-installer  oracle-java8-set-default
dpkg: error processing package oracle-java8-set-default (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 oracle-java8-installer
 oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试使用以下方法清理 apt

sudo apt-get clean 

尝试从中删除所有内容/var/cache regarding oracle-java8,但每当我尝试从中删除每个锁文件时,/var/cache/oracle-java8-installer我都会尝试从中删除每个锁文件/var/cache and var/lib/dpkg

我也试过

sudo apt-get -f install

无论我尝试使用什么进行安装sudo apt-get,都会出现此错误:(。

答案1

这更像是网络故障。

如果一切正常,您可以尝试离线安装脱机安装 Java

也尝试

sudo apt-get purge

清理配置

sudo apt-get update

应该列出你中途构建的所有软件包。

相关内容