Error occurring during the signature verification of apt-get update

22k Views Asked by At

I follow official docker instructions to install docker on ubuntu 18.04 LTS from https://docs.docker.com/install/linux/docker-ce/ubuntu/

Using the setting up repository I ran:

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

and

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

and finaly

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Then, running sudo apt-get update I have errors :

Hit:1 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                       
Hit:3 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease                               
Err:1 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic InRelease                                         
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                        
Ign:7 https://download.docker.com/linux/ubuntu buster InRelease                                              
Err:2 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease                                
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Hit:8 http://us.archive.ubuntu.com/ubuntu bionic InRelease                                                    
Hit:4 http://cdn-fastly.deb.debian.org/debian experimental InRelease                                          
Hit:5 http://cdn-fastly.deb.debian.org/debian sid InRelease                                                   
Hit:9 http://us.archive.ubuntu.com/ubuntu xenial InRelease                      
Err:10 https://download.docker.com/linux/ubuntu buster Release                  
  404  Not Found [IP: 143.204.229.105 443]
Err:3 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:8 http://us.archive.ubuntu.com/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:9 http://us.archive.ubuntu.com/ubuntu xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Err:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'https://download.docker.com/linux/ubuntu buster Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32

and I could not install docker using :

sudo apt-get install docker-ce docker-ce-cli containerd.io

What shall I do to get read of these error and go back to a normal configuration ?

Thank you in advance.

2

There are 2 best solutions below

0
On

i fixed this issue after following this https://thecodecloud.in/solved-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available/

i checked the exact error while updating ubuntu repo. Then i used the below command that worked successfully meanwhile we have to copy key from the error and paste in below command.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ????????????????
3
On

I could fix this issue following https://chrisjean.com/fix-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available/

briefly : Looking at the error above, apt is telling us that the following keys is missing: 3B4FE6ACC0B21F32. Notice that these are listed multiple times. Each unique key will only need to be added once.

To add these keys, I ran the following commands:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5