
我找到了一些安裝最新版本 R 的說明,但它們都非常複雜。儘管如此,我還是嘗試了它們,但它們沒有用。難道真的沒有簡單的方法來完成這件事嗎?
我試過
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran36/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt update
有兩個不同的 URL 並且總是得到類似的東西
Get:21 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages [51.4 kB]
Reading package lists... Done
E: The repository 'http://www.stats.bris.ac.uk/R/bin/linux/ubuntu bionic/ Release' does not have a Release file.
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.
W: GPG error: http://archive.canonical.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
E: The repository 'http://archive.canonical.com precise Release' 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.
(我也嘗試過使用 --allow-unauthenticated,儘管這樣做感覺不舒服,但這並沒有改變任何事情。)
我也嘗試過
sudo echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" >> /etc/apt/sources.list
但這也沒有幫助。 (這需要我 chown 該文件。這太荒謬了)
順便說一句,r-project 網站本身說「要獲取最新的 R 3.4 軟體包,請添加一個條目,例如
deb https://cloud.r-project.org/bin/linux/ubuntu xenial/
``
最後,毫不奇怪,嘗試從來源安裝也會崩潰,並顯示以下訊息
Configure: error: Maybe check LDFLAGS for paths to Fortran libraries?
我需要 R3.6,因為我需要運行的某些軟體需要它。不過,從Google搜尋來看,R3.6 似乎並不存在。
答案1
您的錯誤出現在您要新增的儲存庫中。
https://cloud.r-project.org/bin/linux/ubuntu仿生-cran36/
使用bionic-cran35儲存庫。 R3.6 在 ubuntu 18 上可以正常安裝。
https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04-quickstart
在 19 年春天的一台機器上,我也使用了 36 儲存庫,在 35 之前有 r3.6。我最終安裝了 19.10 軟體包,效果很好。我剛剛刪除了它們,並今天使用適當的存儲庫在我的計算機上正確安裝了 r3.6。