오류: CA 인증서가 손상되었거나 완전히 설치되지 않았습니다.

오류: CA 인증서가 손상되었거나 완전히 설치되지 않았습니다.

명령을 사용하여 자체 서명된 SSL 인증서를 설치하려고 했지만 sudo dpkg-reconfigure ca-certificates완료되기 전에 정전으로 인해 컴퓨터가 재설정되었습니다.

이제 명령을 실행하면 sudo dpkg-reconfigure ca-certificates다음과 같은 오류가 발생합니다.

sudo dpkg-reconfigure ca-certificates
/usr/sbin/dpkg-reconfigure: ca-certificates is broken or not fully installed

시도하면 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.

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)

이 때문에 내 작업을 Git 저장소에 푸시할 수도 없습니다. 그렇게 하려고 하면 다음과 같은 오류가 발생합니다.

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

Ubuntu를 다시 설치하지 않고도 이 문제를 해결하는 방법을 아는 사람이 있습니까? 친절하게 도와주세요.

답변1

c_rehash perl 스크립트에 버그가 있는 것 같습니다(비슷한 오류가 발생하는데 다음 토론을 발견했습니다:https://aur.archlinux.org/packages/icaclient/?comments=all). 내 시스템의 /bin/c_rehash(archlinux, 귀하의 시스템이 /usr/bin/c_rehash에 있는 것처럼 보임)에 일부 따옴표가 누락되어 있습니다. 나는 이것을 변경해야 했습니다(파일 상단 근처):

my $dir = /etc/ssl;
my $prefix = /usr;

에게:

my $dir = "/etc/ssl";
my $prefix = "/usr";

그리고 그것은 효과가있었습니다.

답변2

제 경우에는 CA 인증서 설정을 잘못 닫아 파일이 손상되었습니다. 'debconf'를 다시 설치/업데이트하면 문제가 해결되었습니다.

sudo apt-get install debconf

관련 정보