Apt-get update Err:1 https://download.docker.com/linux/ubuntu jammy InRelease Certificate verification failed: The certificate is NOT trusted

I want to install docker by following the steps in [Install Docker Engine on Ubuntu | Docker Docs] but when I run the apt-get update command I get the following error

Err:1 Index of linux/ubuntu/ jammy InRelease
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 52.85.5.22 443]

try doing Steps 2 and 3 from Setting up the repository there was probably an error there that you missed

I previously installed doker on this pc and deleted it. Now I want to install it again.

sudo apt-get update

command in step 1 gives an error. Also as you said, gives an error when I run the commands in the above step 2. and 3.

root@mobilvatandas:/etc/apt# sudo mkdir -p /etc/apt/keyrings
root@mobilvatandas:/etc/apt# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

curl: (60) SSL certificate problem: self-signed certificate in certificate chain
More details here: curl - SSL CA Certificates

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
gpg: no valid OpenPGP data found.

According to a similar issue, it might be because the ca-certificate is not up to date try updating it, and just to be sure there are no other issues try updating the other packages used to install the certificate keys as well.

 sudo apt-get update
 sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
1 Like

After rebooting I ran the commands again and it worked. I don’t understand?

1 Like

try it
sudo apt-get -o “Acquire::https::Verify-Peer=false” update

ignoring a certificate error is usually not a good idea. It was worth mentioning as an option, but it is better if you also mention what it does :slight_smile: