Score:0

Cannot update ca-certificates - ln: failed to create symbolic link '/etc/ssl/certs/.pem' -> '': No such file or directory

cn flag

Searching the forums I have found many links related to softlinks, but nothing related to the issue that I am facing. I have tried to run the the following command. apt upgrade -- I am looking to run the dist-upgrade from 20.04 to 22.04, but cannot get past this error.

apt upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
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] 
Setting up ca-certificates (20211016~20.04.1) ...
Updating certificates in /etc/ssl/certs...
ln: failed to create symbolic link '/etc/ssl/certs/.pem' -> '': No such file or directory
dpkg: error processing package ca-certificates (--configure):
 installed ca-certificates package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 ca-certificates
E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't understand what link is trying to be created with the following line.

ln: failed to create symbolic link '/etc/ssl/certs/.pem' -> '': No such file or directory

It seems to be searching for a .pem file, there is no filename related to this.

I have also tried to run the following to no avail.

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

I ran this as well to remove the package.

dpkg -P --force-depends ca-certificates
(Reading database ... 180559 files and directories currently installed.)
Removing ca-certificates (20211016~20.04.1) ...
Removing dangling symlinks from /etc/ssl/certs... done.
Purging configuration files for ca-certificates (20211016~20.04.1) ...
Removing dangling symlinks from /etc/ssl/certs... done.
Processing triggers for man-db (2.9.1-1) ...

I have now run out of ideas and cannot find any ideas on the forums. Does anyone have any idea how I can fix this broken package

muru avatar
us flag
Is there a `/etc/ssl/certs/.pem` file? Try moving it elsewhere (or deleting if it's not necessary)
lslamp avatar
cn flag
@muru Thanks for the idea. I checked and there is no .pem file in the dir. What would happen if I move all the files out. Will they be recreated if I reinstall ca-certs I tried to move the verts directory away from the location and I still get the same error with the /etc/ssl/certs directory being empty.
lslamp avatar
cn flag
In the meantime I tried the following. I deleted all the content within the directory /etc/ssl/certs/. After deletion I ran the following command. dpkg-reconfigure ca-certificates I ran into the same error. I then looked into the /etc/ssl/certs dir and 129 links were created as follows USERTrust_ECC_Certification_Authority.pem -> /usr/share/ca-certificates/mozilla/USERTrust_ECC_Certification_Authority.crt If this is the case and new softlinks were created, then the error makes no sense. Any ideas would be much appreciated. Lawrence
Andrew Lowther avatar
jp flag
try running `bash -x update-ca-certificates`. It will print each step in that bash script and should help debug whatever file is causing the broken `ln` command.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.