
我要安裝R-base
sid這裡在 Debian 中。如果安裝的一些CRAN套件能夠保留在SID版本中那就太好了。程式碼
sudo apt install r-base/unstable
輸出
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Release 'unstable' for 'r-base' was not found
我也嘗試過沒有成功sudo apt-get install r-base/unstable
。我在 中找不到 R apt search R-base| grep 3.4
3.4.x。我認為在 中添加 R-base sid 的來源就足夠了/etc/apt/sources.list
。但是,我在包主頁上找不到確切的地址。
作業系統:Debian 8.7
R:目前 3.3.3
答案1
跟著CRAN 官方說明並對 進行適當的更改/etc/apt/sources.list
。
然後,要安裝向後移植的 R 3.4 軟體包,您可以執行以下操作
sudo apt-get -t jessie-backports install r-base
答案2
經過對官方說明的一些嘗試和錯誤後,以下內容對我有用:
使用文字編輯器將以下內容新增至etc/apt/sources.list
:
deb [trusted=yes] http://ftp.us.debian.org/debian sid main
deb-src [trusted=yes] http://ftp.us.debian.org/debian sid main
(小心,這裡我們添加了對更多的不僅僅是 R)。
您也可以使用命令列執行所有操作,例如
d0="[trusted=yes] http://ftp.us.debian.org/debian sid main"
d1="deb $d0"
d2="deb-src $d0"
sudo (echo "$d1"; echo "$d2") >> /etc/apt/sources.list
## check this worked
cat /etc/apt/sources.list
然後
### ensure have keyring
sudo apt-get install -y debian-archive-keyring
## add key for R (I think this is still necessary)
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
### ensure no errors with apt-get update
sudo apt-get install -y libappstream4
sudo apt-get update
sudo apt-get install -y r-base r-base-dev libopenblas-base
sudo apt-get autoremove