새소식

사용팁/System Digging

[ubuntu 20.04] apt NO_PUBKEY grafana / scootersoftware

  • -

오랜만에 들어간 Ubuntu 20.04 서버에서 sudp apt update 명령을 내렸더니

패키지 172이(가) 업그레이드되었습니다. 'apt list --upgradable'를 실행하여 확인해 보십시오.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.grafana.com/oss/deb stable InRelease: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 9E439B102CF3C0C6
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://repos.influxdata.com/ubuntu focal InRelease: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY D8FF8E1F7DF8B07E
W: https://packages.grafana.com/oss/deb/dists/stable/InRelease 파일을 받는데 실패했습니다  다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 9E439B102CF3C0C6
W: https://repos.influxdata.com/ubuntu/dists/focal/InRelease 파일을 받는데 실패했습니다  다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY D8FF8E1F7DF8B07E
W: Some index files failed to download. They have been ignored, or old ones used instead.

위와 같은 오류가 발생했습니다.

핵심을 보면 grafana.com 쪽 저장소에서 NO_PUBKEY 9E439B102CF3C0C6 오류가, influxdata.com 저장소에서 NO_PUBKEY D8FF8E1F7DF8B07E 오류가 발생했다는 내용입니다.

 

원인과 해결 과정을 정리합니다.

 

원인: 2023.01.04 에서 CircleCI 에서 비밀 키를 교체하라는 권고가 있어서 grafana 와 influxdata 에서 이를 시행

해결: 새 gpg 키 다운로드 및 apt list 에 적용

  • 기존 키를 지우라고 합니다.
    • apt-key list | grep -i grafana | wc -l  실행 결과가 0이 아니면 기존 키가 존재합니다. 다음 명령으로 삭제
      • grafana 의 키는 다음으로 삭제
        • apt-key del 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 
      • influxdata 는 apt list 수정할 때 반영됨
  • 새 gpg 키 받아서 저장
    • grafana
      • sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
    • influxdata
      • curl -fsSL https://repos.influxdata.com/influxdata-archive_compat.key | \
           gpg --dearmor | \
           sudo tee  /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
  • apt list 수정
    • 위치 찾기
      • grep 'grafana\|influxdata' /etc/apt/ -rn
        /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg 바이너리 파일 일치함
        /etc/apt/trusted.gpg 바이너리 파일 일치함
        /etc/apt/sources.list.d/grafana.list:1:deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/oss/deb stable main
        /etc/apt/sources.list.d/influxdb.list:1:deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/ubuntu focal stable
    • root 권한으로 열어서 [] 로 둘러쌓인 부분을 수정. 없으면 추가
      • grafana
        • deb [signed-by=/usr/share/keyrings/grafana.key] https://........
      • influxdata
        • deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://......
  • apt 캐시 갱신
    • apt update 명령 실행해서 아까와 같은 NO_PUBKEY 메시지가 해당 저장소 주소에서 발생하면 성공!!

비슷한 케이스로 이번엔 scootersoftware 오류가 발생했습니다.

검색해보니 이 글에서 04-Apr-2014, 11:38 AM 댓글에 새 인증서 링크를 알려줍니다.
다음 명령으로 키를 갱신했습니다.
curl https://www.scootersoftware.com/RPM-GPG-KEY-scootersoftware | sudo apt-key add -

 

다시 sudo apt update 명령 내리니 문제없이 접근합니다.


 

참고: https://grafana.com/blog/2023/01/12/grafana-labs-update-regarding-circleci-security-updates/ , https://github.com/influxdata/telegraf/issues/12563

https://forum.scootersoftware.com/forum/beyond-compare-4-discussion/linux-aa/10753-no_pubkey-331d6dde7f8840ce

 

Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.