Ubuntu 20.04 上的 ca-certificates-java 错误

Ubuntu 20.04 上的 ca-certificates-java 错误

我无法安装任何东西,每次安装都会出现此错误

Setting up ca-certificates-java (20190405ubuntu1) ... 
head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory Error occurred during initialization of boot layer
java.lang.NoClassDefFoundError: ja~a/io/File$PathStatus (wrong name:
java/io/Fil e$PathStatus) dpkg: error processing package
ca-certificates-java (--configure):  installed ca-certificates-java
package post-installation script subprocess retu rned error exit
status 1 Processing triggers for ca-certificates (20210119~20.04.1)
... Updating certificates in /etc/ssl/certs... 0 added, 0 removed;
done. Running hooks in /etc/ca-certificates/update.d...
 
Error occurred during initialization of boot layer
java.lang.NoClassDefFoundError: ja~a/io/File$PathStatus (wrong name:
java/io/Fil e$PathStatus) E:
/etc/ca-certificates/update.d/jks-keystore exited with code 1. done.
Errors were encountered while processing:  ca-certificates-java E:
Sub-process /usr/bin/dpkg returned an error code (1)

我试过dpkg --force-depends --configure ca-certificates-java,但无法解决问题

答案1

您可能需要通过以下方式重新创建已删除的目录

sudo mkdir /etc/ssl/certs/java/

然后重新安装包含上述目录中文件的软件包

sudo apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" --reinstall ca-certificates-java ssl-cert openssl ca-certificates

相关内容