Skip to content

Instantly share code, notes, and snippets.

@wellington1993
Last active September 1, 2023 16:05
Show Gist options
  • Save wellington1993/054e8393be1cdeffabe5a6496ed8cbd1 to your computer and use it in GitHub Desktop.
Save wellington1993/054e8393be1cdeffabe5a6496ed8cbd1 to your computer and use it in GitHub Desktop.
Fix update: NO_PUBKEY A2F683C52980AECF VirtualBox PPA and Others
#W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1)
#W: Não existem chaves públicas para os seguintes IDs de chaves:
1397BC53640DB551
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# From:
# https://www.vivaolinux.com.br/topico/Navegadores/Problema-ao-atualizar-o-Google-Chrome-no-Ubuntu
# W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.virtualbox.org/virtualbox/debian xenial InRelease: As assinaturas a seguir não puderam ser verificadas devido à chave pública não estar disponível: NO_PUBKEY A2F683C52980AECF
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | sudo apt-key add -
# From:
# http://www.ubuntuupdates.org/ppa/virtualbox.org_contrib
@RushOnline
Copy link

RushOnline commented Sep 8, 2022

Not working for me :(

root@arcturus:/# wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | sudo apt-key add -
OK

root@arcturus:/# apt update 
Hit:1 http://repo.yandex.ru/yandex-disk/deb stable InRelease
Hit:2 http://ru.archive.ubuntu.com/ubuntu focal InRelease                                                                                                                                    
Hit:3 http://ru.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                            
Hit:4 http://archive.canonical.com/ubuntu focal InRelease                                                                                                                                    
Hit:5 http://packages.microsoft.com/repos/code stable InRelease                                                                                                                          
Hit:6 http://ru.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                                
Hit:7 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                             
Get:8 https://download.virtualbox.org/virtualbox/debian focal InRelease [4 428 B]                                                            
Err:8 https://download.virtualbox.org/virtualbox/debian focal InRelease                          
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF
Hit:9 https://brave-browser-apt-release.s3.brave.com stable InRelease
Reading package lists... Done
W: GPG error: https://download.virtualbox.org/virtualbox/debian focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF
E: The repository 'https://download.virtualbox.org/virtualbox/debian focal InRelease' is not signed.
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.

@RushOnline
Copy link

root@arcturus:/# wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | md5sum            
f8474c56986af443f43a735e41d58a29  -

@RushOnline
Copy link

SOLVED

# wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | sudo apt-key add -
OK
# git diff -- virtualbox.list
diff --git a/apt/sources.list.d/virtualbox.list b/apt/sources.list.d/virtualbox.list
index 99c6693..342a5fe 100644
--- a/apt/sources.list.d/virtualbox.list
+++ b/apt/sources.list.d/virtualbox.list
@@ -1,2 +1,2 @@
-deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian focal contrib
+deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian focal contrib

@wellington1993
Copy link
Author

@RushOnline Sorry the delayed response.

@RushOnline
Copy link

@RushOnline Sorry the delayed response.

Thank YOU for sharing!

@blzzua
Copy link

blzzua commented Jun 27, 2023

wget -qO- https://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | gpg --dearmor | sudo apt-key --keyring /usr/share/keyrings/oracle-virtualbox-2016.gpg add -

description:

https://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc - is url where the vendor posted the public key

in /etc/apt/sources.list.d/vbox.list we have line:

deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib

signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg - path on filesystem where must be public key.
but in oracle_vbox.asc is text file, oracle-virtualbox-2016.gpg - must be binary gpg file. gpg --dearmor converts its.
we download oracle_vbox.asc, convert, and save it via apt-key command.

this clears the error but the warning remains.

@RushOnline
Copy link

wget -qO- https://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | gpg --dearmor | sudo apt-key --keyring /usr/share/keyrings/oracle-virtualbox-2016.gpg add -

О, такое комбо ещё придумать надо, спасибо! :)

@jarkko-hautakorpi
Copy link

On Ubuntu 22.04

sudo su
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor > /etc/apt/trusted.gpg.d/oracle-virtualbox-2016.gpg

then add to /etc/apt/sources.list.d/vbox.list
deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib

sudo apt update && apt search virtualbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment