2

I'm trying to install Java JDK per this YouTube tutorial:. I get to the part where I run sudo dpkg -i <FILENAME> and it gives me this:

(Reading database ... 185728 files and directories currently installed.)
Preparing to unpack javajava.deb ...
Unpacking jdk-17 (17.0.2-ga) over (17.0.2-ga) ...
dpkg: dependency problems prevent configuration of jdk-17:
 jdk-17 depends on libc6-i386; however:
  Package libc6-i386 is not installed.
 jdk-17 depends on libc6-x32; however:
  Package libc6-x32 is not installed.

dpkg: error processing package jdk-17 (--install): dependency problems - leaving unconfigured Errors were encountered while processing: jdk-17

I noticed I'm missing a couple of packages, so I tried running sudo apt-get install libc6:i386. That throws a similar error about dependencies on yet more packages.

I've also run sudo apt update and sudo apt upgrade.

Any help would be greatly appreciated

MDeBusk
  • 1,175
  • 2
  • 8
  • 21
  • 1
    You've not mentioned your OS, release and architecture details. The package version you did provide doesn't match any supported release. – guiverc Mar 17 '22 at 12:30
  • @guiverc Java Oracle 17 is available. https://www.oracle.com/java/technologies/downloads/ The Oracle website says. – Logan Mar 17 '22 at 16:02
  • See this for a potential solution to your situation: https://askubuntu.com/questions/40011/how-to-let-dpkg-i-install-dependencies-for-me – Logan Mar 17 '22 at 16:18
  • if you just want jdk do sudo apt install openjdk-17-jdk – lnee Mar 17 '22 at 17:24

3 Answers3

7

While installing java jdk i also got the same type of this problem.to fibure that read terminal error carefully. It tells,

jdk-18 depends on libc6-i386; however:
  Package libc6-i386 is not installed.

to figure this,

sudo apt --fix-broken install

After that unpack debian package again.

1

You need to install them together. I go through the process below.

Reproduced the error:

$ sudo dpkg -i jdk-17.0.1_linux-x64_bin.deb

(Reading database ... 181449 files and directories currently installed.) Preparing to unpack jdk-17.0.1_linux-x64_bin.deb ... Unpacking jdk-17 (17.0.1-ga) over (17.0.1-ga) ... dpkg: dependency problems prevent configuration of jdk-17: jdk-17 depends on libc6-i386; however: Package libc6-i386 is not installed. jdk-17 depends on libc6-x32; however: Package libc6-x32 is not installed.

dpkg: error processing package jdk-17 (--install): dependency problems - leaving unconfigured Errors were encountered while processing: jdk-17

Solution:

$ sudo apt-get install libc6-i386 libc6-x32

Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: systemd-hwe-hwdb Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: libc6-i386 libc6-x32 0 to upgrade, 2 to newly install, 0 to remove and 99 not to upgrade. 1 not fully installed or removed. Need to get 5,815 kB of archives. After this operation, 25.4 MB of additional disk space will be used. Get:1 http://au.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-i386 amd64 2.35-0ubuntu3.1 [2,837 kB] Get:2 http://au.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-x32 amd64 2.35-0ubuntu3.1 [2,978 kB] Fetched 5,815 kB in 1s (5,290 kB/s)
Selecting previously unselected package libc6-i386. (Reading database ... 181449 files and directories currently installed.) Preparing to unpack .../libc6-i386_2.35-0ubuntu3.1_amd64.deb ... Unpacking libc6-i386 (2.35-0ubuntu3.1) ... Selecting previously unselected package libc6-x32. Preparing to unpack .../libc6-x32_2.35-0ubuntu3.1_amd64.deb ... Unpacking libc6-x32 (2.35-0ubuntu3.1) ... Setting up libc6-x32 (2.35-0ubuntu3.1) ... Setting up libc6-i386 (2.35-0ubuntu3.1) ... Setting up jdk-17 (17.0.1-ga) ... Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

Confirmation:

$ sudo dpkg -i jdk-17.0.1_linux-x64_bin.deb

(Reading database ... 182019 files and directories currently installed.) Preparing to unpack jdk-17.0.1_linux-x64_bin.deb ... Unpacking jdk-17 (17.0.1-ga) over (17.0.1-ga) ... Setting up jdk-17 (17.0.1-ga) ...

0

press Alt+F2 and Enter “update-manager -cd” to go to software and security and check all the boxes like the answer to this link How to install libc6:i386 on 16.04.4 64bit?

then open the terminal, where you have downloaded the .deb file and run:

sudo apt-get update
sudo apt-get install -f
sudo dpkg -i filename.deb

This worked for me :)

Pilot6
  • 90,100
  • 91
  • 213
  • 324
Sara
  • 51