본문 바로가기
Linux/Tips&News

apt update 실행 시 NO_PUBKEY 오류

by 드로니뚜벅이 2022. 12. 12.

우부투에서 업데이트 명령어를 실행하면 공개키 관련 인증 오류 메시지가 출력되는 경우가 있습니다.

$ sudo apt update                                                               
기존:1 https://packages.microsoft.com/repos/vscode stable InRelease
받기:2 http://repo.mysql.com/apt/ubuntu focal InRelease [12.9 kB]                                       
기존:3 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease                                     
기존:4 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease                                     
기존:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                       
기존:6 http://kr.archive.ubuntu.com/ubuntu focal InRelease                                              
받기:7 http://repo.mysql.com/apt/ubuntu focal/mysql-8.0 Sources [963 B]                                 
기존:9 http://kr.archive.ubuntu.com/ubuntu focal-updates InRelease                                      
기존:10 http://ppa.launchpad.net/kevinkreiser/prime-server/ubuntu focal InRelease                       
기존:11 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease                    
받기:12 http://repo.mysql.com/apt/ubuntu focal/mysql-apt-config i386 Packages [567 B]                   
기존:13 http://ppa.launchpad.net/linuxuprising/shutter/ubuntu focal InRelease                           
받기:8 https://ubuntu.qgis.org/ubuntu focal InRelease [2,718 B]                                         
오류:8 https://ubuntu.qgis.org/ubuntu focal InRelease                                                   
  다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY D155B8E6A419C5BE
기존:14 http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu focal InRelease
...

 

GPG란? GNU Privacy Guard의 OpenPGP 입니다.
OpenPGP 표준을 사용하여 디지털 암호화 및 서명 서비스를 제공하는 툴로 공용키 시스템에서 각 사용자는 개인키와 공용키로 구성된 키 쌍을 가집니다.
사용자의 개인 키는 비밀로 유지되므로 절대 공개할 필요가 없고 공개키는 이용자가 소통하고자 하는 사람에게 누구나 부여할 수 있습니다. 즉 배포 파일의 인증을 확인하는데 사용되느 소프트웨어 패키지 입니다.

 

위 메시지에서 등록되지 않은 공개키때문에 인증할 수 없다는 메시지가 출력되었습니다. 따라서, 해당 키를 등록해 주세요.

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D155B8E6A419C5BE                
Executing: /tmp/apt-key-gpghome.7dR5Y8OK4D/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys D155B8E6A419C5BE
gpg: key D155B8E6A419C5BE: public key "QGIS Archive Automatic Signing Key (2022-2027) <qgis-developer@lists.osgeo.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1

 

등록 후 다시 업데이트를 실행하시면 해당 오류가 출력되지 않습니다.

$ sudo apt update 
기존:1 http://repo.mysql.com/apt/ubuntu focal InRelease
기존:2 https://packages.microsoft.com/repos/vscode stable InRelease                                     
기존:3 http://kr.archive.ubuntu.com/ubuntu focal InRelease                                              
기존:4 http://kr.archive.ubuntu.com/ubuntu focal-updates InRelease                                      
기존:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                       
기존:6 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease                                     
기존:8 http://ppa.launchpad.net/kevinkreiser/prime-server/ubuntu focal InRelease                        
기존:9 http://ppa.launchpad.net/linuxuprising/shutter/ubuntu focal InRelease                            
기존:7 https://ubuntu.qgis.org/ubuntu focal InRelease                                                   
기존:10 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease                                    
기존:11 http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu focal InRelease                          
기존:12 https://repos.codelite.org/ubuntu focal InRelease                                               
기존:13 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease                         
기존:14 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease                    
기존:15 http://ppa.launchpad.net/wireshark-dev/stable/ubuntu focal InRelease                            
패키지 목록을 읽는 중입니다... 완료                                
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료