Ubuntu

Ubuntu 添加 repo app-key 失敗

  • March 2, 2021

在 Ubuntu 20.04 LTS 上,我正在嘗試安裝 MongoDB、Sublime Text 3 等軟體包,但在添加它們之前,必須添加它們的 repo url。我正在嘗試這個命令:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

並且這條消息失敗了:

gpg: invalid key resource URL '/tmp/apt-key-gpghome.Mi0IvTayBR/home:hawkeye116477:waterfox.asc.gpg'
gpg: keyblock resource '(null)': General error
gpg: key 7721F63BD38B4796: 2 signatures not checked due to missing keys
gpg: key 5E62D791625A271E: 1 signature not checked due to a missing key
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: Total number processed: 12
gpg:       skipped new keys: 12

使固定?

剛剛遇到一個非常相似的問題,通過刪除問題鍵,/etc/apt/trusted.gpg.d/{Problem-Key}.asc我能夠解決問題!

希望這可以幫助!

這是因為 GPG 將包含冒號的密鑰環路徑解析為 URL(是的,我也不知道)。

嘗試以下操作:

mv /etc/apt/trusted.gpg.d/home:hawkeye116477:waterfox.asc /etc/apt/trusted.gpg.d/home_hawkeye116477_waterfox.asc

引用自:https://serverfault.com/questions/1022078