在 Ubuntu 22.04 上安裝 R

在 Ubuntu 22.04 上安裝 R

我剛剛將我的裝置更新到 Ubuntu 22.04,我想按照此自述文件安裝 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.

有誰知道如何解決這個問題?我已經嘗試了自述文件中的所有儲存庫,結果相同。

答案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

相關內容