dpkg: error processing package oracle-java8-installer (--configure):

前端 未结 5 887
小鲜肉
小鲜肉 2020-12-30 02:51

I am trying to install sbt on Ubuntu 16.04. I have mistakenly stopped the process when running the following command,

sudo apt-get install sbt
5条回答
  •  [愿得一人]
    2020-12-30 03:38


    !! NOTE !! This solution may not work if Oracle stops serving files from their FTP service. They do that for older Java releases.


    When using ppa:webupd8team/java there can be deprecated/archived Oracle links hardcoded in PPA. Oracle is moving their older versions to archive and PPA has internal links to "active" (at the time of PPA creation) Oracle download versions.

    The maintainer of ppa:webupd8team/java is only one man - Andrew (see here)

    Problem

    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)
    

    Solution

    cd /var/lib/dpkg/info
    sudo sed -i 's|JAVA_VERSION=8u151|JAVA_VERSION=8u162|' oracle-java8-installer.*
    sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/|' oracle-java8-installer.*
    sudo sed -i 's|SHA256SUM_TGZ="c78200ce409367b296ec39be4427f020e2c585470c4eed01021feada576f027f"|SHA256SUM_TGZ="68ec82d47fd9c2b8eb84225b6db398a72008285fafc98631b1ff8d2229680257"|' oracle-java8-installer.*
    sudo sed -i 's|J_DIR=jdk1.8.0_151|J_DIR=jdk1.8.0_162|' oracle-java8-installer.*
    

    Java versions change "often" so update 8u151 and 8u162 to reflect your environment. (this versions worked on Ubuntu 16.04.3 LTS - 2018-01-18)

    Try again

    apt install oracle-java8-installer
    apt install oracle-java8-set-default
    

    Read more about the problem

    • https://ubuntuforums.org/showthread.php?t=2374686&p=13699352#post13699352
    • https://disqus.com/home/discussion/webupd8/install_oracle_java_8_in_ubuntu_via_ppa_jdk8_web_upd8_ubuntu_linux_blog/newest/
    • http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

提交回复
热议问题