DNS解析因未知原因失敗
在我的 64 位 kali linux 中安裝 jdk 8 時出現以下錯誤。
root@kali:~# apt-get install oracle-java8-installer Reading package lists... Done Building dependency tree Reading state information... Done oracle-java8-installer is already the newest version (8u111+8u111arm-1~webupd8~0). The following packages were automatically installed and are no longer required: aapt android-libaapt android-libandroidfw android-libbacktrace android-libbase android-libcutils android-liblog android-libunwind android-libutils android-libziparchive fastjar fonts-dejavu-extra jarwrapper java-wrappers junit libadns1 libantlr-java libantlr3-runtime-java libapache-pom-java libatinject-jsr330-api-java libatk-wrapper-java libatk-wrapper-java-jni libcommons-cli-java libcommons-io-java libcommons-lang3-java libcommons-parent-java libcrypto++6 libguava-java libice-dev libjaxp1.3-java libjsr305-java libpthread-stubs0-dev libsm-dev libsmali-java libstringtemplate-java libx11-dev libx11-doc libxau-dev libxcb1-dev libxdmcp-dev libxmlunit-java libxpp3-java libxt-dev libyaml-snake-java python-adns python-easygui python-levenshtein python-metaconfig python-pycryptopp python-pysnmp4 python-pysnmp4-apps python-pysnmp4-mibs smitools x11proto-core-dev x11proto-input-dev x11proto-kb-dev xorg-sgml-doctools xtrans-dev Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 1463 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-java8-installer (8u111+8u111arm-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc Downloading Oracle Java 8... --2016-12-16 21:05:09-- http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz Resolving false (false)... failed: Name or service not known. wget: unable to resolve host address ‘false’ 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)
我對此進行了很多搜尋,但無法弄清楚是什麼原因造成的。
如果我執行
wget http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz
它工作正常。也可以
nslookup google.com
正常ping google.com
工作。我也刪除了文件中的所有內容,
/var/cache/oracle-jdk8-installer/wgetrc
但同樣的問題。請幫忙!
那是奇特的問題。
DNS 並沒有因為某些奇怪的原因而失敗,您的 DNS 工作正常。但是,您嘗試的軟體包似乎帶有損壞的安裝後腳本,該腳本將“false”作為主機名並將其傳遞給 wget,而不是預期的主機名。
從輸出中可以明顯看出:
…
–2016-12-16 21:05:09– http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz
解決假(假)…失敗:名稱或服務未知。
wget:無法解析主機地址“假”
如果我想更深入地研究它,我會查看 /var/cache/oracle-jdk8-installer/wgetrc 看看那裡是否有問題,
apt-get clean
然後重試。我建議你嘗試實現這個結果 - 使用替代方法安裝 java,例如這裡描述的http://www.2daygeek.com/install-oracle-java-using-java-alternatives-method-on-ubuntu-centos-debian -fedora-mint-rhel-opensuse/看看它是否適合你——這可能是最快的。