我正在尝试安装 Java JDK这个 YouTube 教程:。我到了我运行的部分sudo dpkg -i <FILENAME>
,它给了我这个:
(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
我注意到我缺少几个软件包,所以我尝试运行sudo apt-get install libc6:i386
。这会引发有关更多软件包依赖关系的类似错误。
我也跑过sudo apt update
。sudo apt upgrade
任何帮助将不胜感激
答案1
在安装 java jdk 时,我也遇到了同样的问题。仔细阅读终端错误。它告诉,
jdk-18 depends on libc6-i386; however:
Package libc6-i386 is not installed.
为了弄清楚这一点,
sudo apt --fix-broken install
之后再次解压 debian 包。
答案2
您需要将它们一起安装。我在下面介绍了安装过程。
重现错误:
$ 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
解决方案:
$ 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) ...
确认:
$ 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) ...
答案3
按 Alt+F2 并输入“update-manager -cd”转到软件和安全并选中所有框,如此链接的答案 如何在 16.04.4 64 位上安装 libc6:i386?
然后打开终端,在其中下载.deb 文件并运行:
sudo apt-get update
sudo apt-get install -f
sudo dpkg -i filename.deb
这对我有用:)