-1

Please help me!! I am stuck for the past 3 days and being unable to install java on my ubuntu 18.04; nothing is working out :-(; as I have very little information though I tried like oracle.com>java14 installer kit>downloaded tar.gz file>unable to set it. Below are detailed query:

Neither apt --fix-broken install not working and nor sudo apt autoremove and dpkg is saying not installed but on installing it says dpkg is already on updated version::

adrino@Inspiron:~$ sudo apt-get update
[sudo] password for adrino: 
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease                     
Hit:2 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease             
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease           
Hit:4 http://in.archive.ubuntu.com/ubuntu bionic-security InRelease            
Hit:5 http://packages.microsoft.com/repos/vscode stable InRelease              
Hit:6 http://in.archive.ubuntu.com/ubuntu bionic-proposed InRelease            
Hit:7 http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic InRelease      
Hit:8 https://packagecloud.io/AtomEditor/atom/any any InRelease                
Reading package lists... Done

adrino@Inspiron:~$ sudo apt-get upgradable E: Invalid operation upgradable adrino@Inspiron:~$ sudo apt list upgradable Listing... Done

adrino@Inspiron:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree
Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: default-jdk : Depends: openjdk-11-jdk default-jre : Depends: openjdk-11-jre E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

adrino@Inspiron:~$ sudo apt --fix-broken install Reading package lists... Done Building dependency tree
Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: gstreamer1.0-plugins-base:i386 libasn1-8-heimdal:i386 libasound2:i386 libasound2-plugins:i386 libasyncns0:i386 libatomic1:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libblkid1:i386 libbsd0:i386 libcairo2:i386 libcap2:i386 libcapi20-3:i386 libcdparanoia0:i386 libcom-err2:i386 libcomerr2:i386 libcups2:i386 libdb5.3:i386 libdbus-1-3:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libexif12:i386 libexpat1:i386 libffi6:i386 libflac8:i386 libfontconfig1:i386 libfreetype6:i386 libgcrypt20:i386 libgd3:i386 libgl1:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386 libglib2.0-0:i386 libglu1-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libgmp10:i386 libgnutls30:i386 libgpg-error0:i386 libgphoto2-6:i386 libgphoto2-port12:i386 libgpm2:i386 libgsm1:i386 libgssapi-krb5-2:i386 libgssapi3-heimdal:i386 libgstreamer-plugins-base1.0-0:i386 libgstreamer1.0-0:i386 libhcrypto4-heimdal:i386 libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386 libhogweed4:i386 libhx509-5-heimdal:i386 libicu60:i386 libidn2-0:i386 libieee1284-3:i386 libjack-jackd2-0:i386 libjbig0:i386 libjpeg-turbo8:i386 libjpeg8:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5support0:i386 liblcms2-2:i386 libldap-2.4-2:i386 libllvm10:i386 libltdl7:i386 liblz4-1:i386 libmount1:i386 libmpg123-0:i386 libncurses5:i386 libnettle6:i386 libodbc1:i386 libogg0:i386 libopenal1:i386 libopus0:i386 liborc-0.4-0:i386 libosmesa6:i386 libp11-kit0:i386 libpcap0.8:i386 libpciaccess0:i386 libpixman-1-0:i386 libpng16-16:i386 libpulse0:i386 libroken18-heimdal:i386 libsamplerate0:i386 libsane1:i386 libsasl2-2:i386 libsasl2-modules:i386 libsasl2-modules-db:i386 libsensors4:i386 libsndfile1:i386 libsndio6.1:i386 libspeexdsp1:i386 libsqlite3-0:i386 libssl1.1:i386 libstdc++6:i386 libsystemd0:i386 libtasn1-6:i386 libtheora0:i386 libtiff5:i386 libtinfo5:i386 libudev1:i386 libunistring2:i386 libusb-1.0-0:i386 libuuid1:i386 libv4l-0:i386 libv4lconvert0:i386 libvisual-0.4-0:i386 libvorbis0a:i386 libvorbisenc2:i386 libwebp6:i386 libwind0-heimdal:i386 libwine:i386 libwrap0:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcb1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxml2:i386 libxpm4:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386 libxslt1.1:i386 libxxf86vm1:i386 libzstd1:i386 ocl-icd-libopencl1:i386 wine32:i386 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: gsfonts-x11 oracle-java14-installer oracle-java14-set-default Suggested packages: binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho | ttf-sazanami-mincho ttf-arphic-uming The following NEW packages will be installed: gsfonts-x11 oracle-java14-set-default The following packages will be upgraded: oracle-java14-installer 1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 3 not fully installed or removed. Need to get 0 B/43.4 kB of archives. After this operation, 237 kB of additional disk space will be used. Do you want to continue? [Y/n] y
Preconfiguring packages ... /tmp/oracle-java14-installer.config.E2htyx: 18: /tmp/oracle-java14-installer.config.E2htyx: dpkg: not found oracle-java14-installer failed to preconfigure, with exit status 20 Could not exec dpkg! E: Sub-process /usr/bin/dpkg returned an error code (100)

adrino@Inspiron:~$ sudo apt autoremove Reading package lists... Done Building dependency tree
Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: default-jdk : Depends: openjdk-11-jdk default-jre : Depends: openjdk-11-jre E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

adrino@Inspiron:~$

kannzzmm2
  • 1,090
  • 1
  • 10
  • 26
  • you can install openjdk-14-jdk using the command sudo apt install openjdk-14-jdk which is almost the same as jdk from oracle – kannzzmm2 Aug 16 '20 at 12:07
  • @kannzzmm2 this command would work great in 20.04 and later, but the author is using 18.04. – karel Aug 16 '20 at 12:33

1 Answers1

0

What are you trying to achieve? I see errors on Java 11 packages and errors on Java 14 packages. Which version do you want to install? In any case: my suggestion would be to completely remove all Java packages and then try to install the version you want.

I see two problems, one with oracle-java14-installer and one with openjdk-11-jre. You say you tried to install Java by downloading the .tar.gz file from Oracle, but the problems you are having appear not to be related.

The first problem is with oracle-java14-installer. This seems to come from the package oracle-java14-installer_14.0.2-1~linuxuprising1 from PPA http://ppa.launchpad.net/linuxuprising/java/ubuntu. This is a PPA you've added yourself. Try to delete the package using sudo apt-get --purge remove oracle-java14-*.

The output of sudo apt autoremove says The following packages have unmet dependencies: default-jdk : Depends: openjdk-11-jdk default-jre : Depends: openjdk-11-jre. This looks to me like package openjdk-11-jre is missing. What happens when you install that? Do a sudo apt update first, and then a sudo apt install openjdk-11-jre. Is the output of sudo apt autoremove without errors now?

Jurrie
  • 505
  • on running command sudo apt-get install openjdk-11-jre following is what I am receiving:: – Aaditya Barnwal Aug 16 '20 at 12:52
  • Reading package lists... Done Building dependency tree
    Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: default-jdk : Depends: openjdk-11-jdk openjdk-11-jre : Depends: libgif7 (>= 5.1) but it is not going to be installed Recommends: libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2) but it is not going to be installed Recommends: fonts-dejavu-extra but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
    – Aaditya Barnwal Aug 16 '20 at 12:53
  • result of sudo apt autoremove is Reading package lists... Done Building dependency tree
    Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: default-jdk : Depends: openjdk-11-jdk default-jre : Depends: openjdk-11-jre E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
    – Aaditya Barnwal Aug 16 '20 at 12:57
  • But what are you trying to achieve? The output of sudo apt-get install openjdk-11-jre lists another package that is missing. Try to find that one yourself as an exercise! By combining your original question, my post, and your comment. – Jurrie Aug 16 '20 at 13:34