Ошибка: ca-certificates поврежден или не полностью установлен

Ошибка: ca-certificates поврежден или не полностью установлен

Я пытался установить самоподписанный 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

Похоже, в скрипте perl c_rehash есть ошибка (я получаю похожие ошибки и нашел это обсуждение):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-certificates привело к повреждению файла. Переустановка/обновление 'debconf' решило мою проблему:

sudo apt-get install debconf

Связанный контент