我遇到這個錯誤很久了,但無法找到解決方案。每當我嘗試使用安裝任何東西時
$ 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
應該列出您中途建立的所有軟體包。