W: GPG error: http://downloads-distro.mongodb.org dist Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9ECBEC467F0CEB10
W: GPG error: http://mirrors.advancedhosters.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://mirrors.advancedhosters.com trusty-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://mirrors.advancedhosters.com trusty-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://download.bitdefender.com bitdefender Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A373FB480EC4FE05
W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.getdeb.net trusty-getdeb InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A8A515F046D7E7CF
W: GPG error: http://liveusb.info all Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4E940D7FDD7FB8CC
W: GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
W: GPG error: http://developer.download.nvidia.com Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D88C3D385C37D3BE
W: GPG error: http://ftp.yz.yamagata-u.ac.jp saucy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CBCB082A1BB943DB
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 620396F19C0042C8
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0C14D55CE7242835
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 531EE72F4C9D234C
기본적으로 나는 canonical 에서 기본적으로 사용하는 repository를 제외하고 launchpad.net 에서 각 개발자들이 제공하는 repository를 꽤 많이 사용하고 있었다. 이게 KEY 파일이 40개를 넘어가는 순간 발생하는 에러일 수도 있고, apt-get update 시 리스트 갱신이 안되는 경우가 있는 몇가지 경우로 인터넷에도 참 많은 정보가 떠돈다.
그중에서 가장 신빙성있어보고 실제로 나의 경우에 오류처리가 해결된 해법을 기술한다.
위와 같은 에러문구로 기본 repository 부터 이후 추가된 repository까지 모두 에러가 발생한다. 이게 14.04 이후 버전에서는 수정이 되었다는 이야기도 있는데.. 일단 LTE버전만 사용하기로 한 나의 경우엔 16.04 버전이 나오기전까지는 해결 방안이 없다;;;
나의 경우는 3rd-party repository를 검색해서 최신버전을 설치하는 것을 즐기는 편인데, 이러는 경우 필요하면 add-apt-repository했다가 다시 제거하고 한 경우가 좀 있었다. 이러다가 이게 repository를 제거하더라도 key 파일은 삭제되지 않아서 계속 누적되고 그 수가 40이 넘어가는 순간 업데이트 에러가 발생한 경우이다.
자.. 해결방안
쉽게 얘기해서 key파일을 모두 제거하고 필요한 key파일만 key server에서 다시 내려받고 업데이트를 다시 진행한다. 요거다.
$ cd /etc/apt/trusted.gpg.d
$ sudo rm -rf ./*
$ sudo apt-get update
위 명령어는 key 파일이 저장되는 디렉토리로 이동해서 기존 key를 모두 제거하고 다시 업데이트 명령을 준것이다.
이러면 맨 위의 에러와 달리 이제는 key 자체가 없다는 오류가 발생한다.
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0856F197B892ACEA
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 591B856E37964957
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E6A5ED249AD24C
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 20221AFD63E0C3B9
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D834D91FA49CCDDB
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 83FBA1751378B444
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 531EE72F4C9D234C
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D530E028F59EAE4D
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 52B709720F164EEB
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 857F87147B9B74AA
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A7E13D78E4A4F4F4
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC6D7D9D009ED615
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B5B116B72D0F61F0
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 799A5FD5D1C5997F
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
이젠 위에 해당하는 key를 다시 다운로드 한다.
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0856F197B892ACEA 591B856E37964957 C5E6A5ED249AD24C 20221AFD63E0C3B9 D834D91FA49CCDDB 83FBA1751378B444 531EE72F4C9D234C D530E028F59EAE4D 52B709720F164EEB 857F87147B9B74AA A7E13D78E4A4F4F4 FC6D7D9D009ED615 B5B116B72D0F61F0 799A5FD5D1C5997F C2518248EEA14886
중복된 key는 한번만 넣으면 된다. 이러면 아래와 같이 정상적으로 key를 가져와서 저장한다.
gpg: requesting key B892ACEA from hkp server keyserver.ubuntu.com
gpg: requesting key 37964957 from hkp server keyserver.ubuntu.com
gpg: requesting key 249AD24C from hkp server keyserver.ubuntu.com
gpg: requesting key 63E0C3B9 from hkp server keyserver.ubuntu.com
gpg: requesting key A49CCDDB from hkp server keyserver.ubuntu.com
gpg: requesting key 1378B444 from hkp server keyserver.ubuntu.com
gpg: requesting key 4C9D234C from hkp server keyserver.ubuntu.com
gpg: requesting key F59EAE4D from hkp server keyserver.ubuntu.com
gpg: requesting key 0F164EEB from hkp server keyserver.ubuntu.com
gpg: requesting key 7B9B74AA from hkp server keyserver.ubuntu.com
gpg: requesting key E4A4F4F4 from hkp server keyserver.ubuntu.com
gpg: requesting key 009ED615 from hkp server keyserver.ubuntu.com
gpg: requesting key 2D0F61F0 from hkp server keyserver.ubuntu.com
gpg: requesting key D1C5997F from hkp server keyserver.ubuntu.com
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: key B892ACEA: public key "Launchpad PPA for Canonical Kernel Team" imported
gpg: key 37964957: public key "Launchpad 3beol" imported
gpg: key 249AD24C: public key "Launchpad PPA for Deluge Team" imported
gpg: key 63E0C3B9: public key "Launchpad PPA for Package Maintainer" imported
gpg: key A49CCDDB: public key "Launchpad PPA for System Load Indicator developers" imported
gpg: key 1378B444: public key "Launchpad PPA for LibreOffice Packaging" imported
gpg: key 4C9D234C: public key "Launchpad webupd8" imported
gpg: key F59EAE4D: public key "Launchpad PPA for NoobsLab" imported
gpg: key 0F164EEB: public key "Launchpad PPA for Numix Maintainers" imported
gpg: key 7B9B74AA: public key "Launchpad PPA for Paolo Rotolo" imported
gpg: key E4A4F4F4: public key "Launchpad PPA named smplayer for rvm" imported
gpg: key 009ED615: public key "Launchpad PPA for Shutter Team" imported
gpg: key 2D0F61F0: public key "Launchpad PPA for Tony George" imported
gpg: key D1C5997F: public key "Launchpad Pynagram" imported
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: Total number processed: 15
gpg: imported: 15 (RSA: 15)
요렇게 처리되면 내가 사용하는 repository에 해당하는 key는 모두 다운로드 된 것으로 다시 업데이트 명령을 입력하면 끝.
$ sudo apt-get update
이젠 정상적으로 업데이트 목록이 갱신되고 정상적으로 앱들을 업데이트 시킬 수 있다.