错误:ca-certificates 已损坏或未完全安装

Adi*_*are 2 certificate ssl dpkg ubuntu

我试图用sudo dpkg-reconfigure ca-certificates命令安装自签名 SSL 证书,但在它完成之前,我的计算机由于电源故障而被重置。

现在,当我运行sudo dpkg-reconfigure ca-certificates命令时,出现以下错误:

sudo dpkg-reconfigure ca-certificates
/usr/sbin/dpkg-reconfigure: ca-certificates is broken or not fully installed
Run Code Online (Sandbox Code Playgroud)

当我尝试时sudo update-ca-certificates,出现以下错误:

sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
Unknown regexp modifier "/b" at /usr/bin/c_rehash line 15, at end of line
Unknown regexp modifier "/W" at /usr/bin/c_rehash line 26, at end of line
Unknown regexp modifier "/3" at /usr/bin/c_rehash line 26, at end of line
Unknown regexp modifier "/2" at /usr/bin/c_rehash line 26, at end of line
No such class installdir at /usr/bin/c_rehash line 58, near "Prefix our installdir"
  (Might be a runaway multi-line // string starting on line 26)
syntax error at /usr/bin/c_rehash line 58, near "Prefix our installdir"
Execution of /usr/bin/c_rehash aborted due to compilation errors.
Run Code Online (Sandbox Code Playgroud)

当我尝试 sudo 时apt install ca-certificates -f,出现以下错误:

sudo apt install ca-certificates -f 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ca-certificates is already the newest version (20160104ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 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 ca-certificates (20160104ubuntu1) ...
Processing triggers for ca-certificates (20160104ubuntu1) ...
Updating certificates in /etc/ssl/certs...
Unknown regexp modifier "/b" at /usr/bin/c_rehash line 15, at end of line
Unknown regexp modifier "/W" at /usr/bin/c_rehash line 26, at end of line
Unknown regexp modifier "/3" at /usr/bin/c_rehash line 26, at end of line
Unknown regexp modifier "/2" at /usr/bin/c_rehash line 26, at end of line
No such class installdir at /usr/bin/c_rehash line 58, near "Prefix our installdir"
  (Might be a runaway multi-line // string starting on line 26)
syntax error at /usr/bin/c_rehash line 58, near "Prefix our installdir"
Execution of /usr/bin/c_rehash aborted due to compilation errors.
dpkg: error processing package ca-certificates (--configure):
 subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
 ca-certificates
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

因此,我什至无法将我的工作推送到 Git 存储库。当我尝试这样做时出现以下错误:

fatal: unable to access 'https://github.com/***/***-tdd.git/': Problem with the SSL CA cert (path? access rights?)
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个问题而我不必重新安装 Ubuntu?请帮忙。

小智 5

就我而言,错误关闭 ca 证书设置会导致文件损坏。重新安装/更新“debconf”解决了我的问题:

sudo apt-get install debconf
Run Code Online (Sandbox Code Playgroud)