Ubuntuのパッケージマネージャでインストール済パッケージの更新チェック時、AnyDeskレポジトリの公開鍵期限切れのエラーが出るようになったので、公式ガイドに沿って鍵を更新しました。
パッケージ更新チェック時にエラー
AnyDeskを入れているUbuntu系のPCである頃より、パッケージマネージャによる更新チェック時、次のエラーが現れるようになりました。公開鍵の期限切れのようです。
|
1 2 3 4 5 6 7 8 |
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.anydesk.com all InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2FB21D5A8772835 E: http://deb.anydesk.com all InRelease is not (yet) available (The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2FB21D5A8772835) |
Kubuntu 24.04のGUIベースのパッケージ管理ツール Discoverにも、パッケージの更新チェック時に同様のエラーが現れます。
調べてみると、レポジトリサイト内に鍵の更新手順がシンプルに記載されていたので、これを元に鍵を更新します。
必要なパッケージの取得
まずはこの作業に必要なパッケージの取得。てっきり、以前に鍵を入手した時と同じと思っていましたが、一部入っていないパッケージがここで新たにインストールされました。
|
1 2 3 4 5 6 7 8 |
$ sudo apt install ca-certificates curl apt-transport-https ca-certificates is already the newest version (20240203~22.04.1). ca-certificates set to manually installed. curl is already the newest version (7.81.0-1ubuntu1.20). curl set to manually installed. The following NEW packages will be installed: apt-transport-https 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. |
新しい鍵の取得と保存
次に、鍵の保存場所ディレクトリを作成し、鍵を取得して保存。この手の鍵の保存場所は /etc/apt/keyrings/ だったり、 /usr/share/keyrings/ だったりとバラバラで、果たしてどちらがふさわしいのか、自分もそこまでの深い理解には至らないことから、ひとまず開発者側の指示に従うことに。
|
1 2 3 |
$ sudo install -m 0755 -d /etc/apt/keyrings $ sudo curl -fsSL https://keys.anydesk.com/repos/DEB-GPG-KEY -o /etc/apt/keyrings/keys.anydesk.com.asc $ sudo chmod a+r /etc/apt/keyrings/keys.anydesk.com.asc |
レポジトリファイルの編集
最後にレポジトリファイルに記載されている鍵のパスを修正します。
|
1 2 |
#deb [arch=amd64 signed-by=/usr/share/keyrings/anydesk-archive-keyring.gpg] http://deb.anydesk.com/ all main deb [arch=amd64 signed-by=/etc/apt/keyrings/keys.anydesk.com.asc] http://deb.anydesk.com/ all main |
ちなみに前述の公式ページでは、新たにレポジトリファイルを出力する感じになっていますね。
|
1 2 |
# Add the AnyDesk apt repository echo "deb [signed-by=/etc/apt/keyrings/keys.anydesk.com.asc] https://deb.anydesk.com all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list > /dev/null |
以上の作業を終えたら、パッケージマネージャでいつものように更新。AnyDeskのレポジトリも正常に受け入れてもらえました。
|
1 2 3 4 5 6 |
$ sudo apt update Hit:1 http://hk.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://hk.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:3 http://hk.archive.ubuntu.com/ubuntu jammy-backports InRelease ... Get:7 http://deb.anydesk.com all InRelease [7,386 B] |
Google Chromeでも鍵期限切れ発生
とかしているうちに、Google Chromeのレポジトリでも同じような鍵期限切れが発生。
|
1 2 3 4 5 |
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 32EE5355A6BC6E42 |
レポジトリファイルは次のようになっているので、
|
1 |
deb [arch=amd64 signed-by=/usr/share/keyrings/chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main |
AnyDeskと同じ要領で新しい鍵をダウンロードします。
|
1 |
$ curl -sS https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor | sudo tee /usr/share/keyrings/chrome-keyring.gpg > /dev/null |
パッケージマネージャで再度更新処理をかけてみて、エラー解消したことを確認しました。
|
1 2 3 |
$ sudo apt update Get:4 http://dl.google.com/linux/chrome/deb stable InRelease [1,825 B] Get:6 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,215 B] |


