Oracle Jdk dpkg error when installing cassandra on Ubuntu 16.04

I am trying to install Cassandra on aws ec2 a free single instance of node ubuntu. I follow this link https://wiki.apache.org/cassandra/DebianPackaging to install cassandra on ubuntu 16.04.

I have successfully completed all the steps to this

udo apt-get install cassandra 

this step gives me an error as shown below:

 Reading package lists... Done Building dependency tree Reading state information... Done cassandra is already the newest version (3.11.1). 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. 2 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 (8u151-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc Downloading Oracle Java 8... --2018-01-17 12:33:48-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz Resolving download.oracle.com (download.oracle.com)... 23.198.126.121 Connecting to download.oracle.com (download.oracle.com)|23.198.126.121|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz [following] --2018-01-17 12:33:48-- https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.122.102.128, 2600:140f:4:1a0::2d3e, 2600:140f:4:196::2d3e Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.122.102.128|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz?AuthParam=1516192549_30e1e90727719cbe83767ebf9151aff5 [following] --2018-01-17 12:33:49-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz?AuthParam=1516192549_30e1e90727719cbe83767ebf9151aff5 Connecting to download.oracle.com (download.oracle.com)|23.198.126.121|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2018-01-17 12:33:51 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 cassandra: cassandra depends on openjdk-8-jre-headless | java8-runtime; however: Package openjdk-8-jre-headless is not installed. Package oracle-java8-installer which provides openjdk-8-jre-headless is not configured yet. Package java8-runtime is not installed. Package oracle-java8-installer which provides java8-runtime is not configured yet. dpkg: error processing package cassandra (--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 cassandra E: Sub-process /usr/bin/dpkg returned an error code (1) 

It says that Oracle jdk is not installed. But I already have Oracle jdk8 installed on my system. Check below:

 $ java -version java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode) $ which java /usr/bin/java $ which javac /usr/bin/javac $ echo $JAVA_HOME /usr/lib/jvm/jdk1.8.0_161 $ sudo update-alternatives --config java [sudo] password for hduser: There is 1 choice for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/jdk1.8.0_161/bin/java 0 auto mode * 1 /usr/lib/jvm/jdk1.8.0_161/bin/java 0 manual mode Press <enter> to keep the current choice[*], or type selection number: 

Please help me solve this problem.

+2
source share
3 answers

Something changed during the loading of Oracle, and almost every script installation on the Internet does not work. Sit back and relax, this question started early in the morning.

+1
source

Alternatively, you can add PPA Oracles and install there using apt-get. Follow the commands below.

 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer javac -version 
0
source

This erorr looks like a ppa problem: webupd8team / java repository. Now the download links are changed and the JDK cannot be downloaded.

0
source

Source: https://habr.com/ru/post/1274763/


All Articles