
デバイスを Ubuntu 22.04 にアップデートしたばかりで、次の readme に従って R をインストールしたいと考えていました。https://cran.r-project.org/bin/linux/ubuntu/fullREADME.html
これは問題なく動作しましたが、パッケージを更新しようとするとエラーが発生します。
~$ sudo apt update
Err:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
Get:7 http://apt.insync.io/ubuntu jammy InRelease [5.531 B]
Reading package lists... Done
W: GPG error: https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
これを解決する方法を誰か知っていますか? Readme にあるすべてのリポジトリを試しましたが、結果は同じです。
答え1
リンク先のガイドの手順を1つ見逃しているようです。キーに署名する必要があります。リンク先の関連行は次のとおりです。
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc