Stu*_*ent 42 apt r software-installation
我一直没有成功尝试安装r-base的最新版本(2.15.2)。显然,R包Rcpp不会为 R 版本 2.14.1 安装 - 为我安装的版本。
我不确定什么/如何/在哪里更改下面显示的安装尝试。请注意,我使用的是 ubuntu-12.04.1-server-i386。
当前安装的版本是 R 版本 2.14.1 (2011-12-22):
$ sudo apt-get install r-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
r-base is already the newest version.
Run Code Online (Sandbox Code Playgroud)
包含版本信息无济于事:
$ sudo apt-get install r-base=2.15.1-5ubuntu1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.15.1-5ubuntu1' for 'r-base' was not found
Run Code Online (Sandbox Code Playgroud)
基于来自http://cran.r-project.org/bin/linux/ubuntu/README 的CRAN Ubuntu 说明的更改:
添加到 /etc/apt/sources.list
deb http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu quantal/
Run Code Online (Sandbox Code Playgroud)更新和安装
$ sudo apt-get update
$ sudo apt-get install r-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 2.15.2-1quantal2) but it is not going to be installed
Depends: r-recommended (= 2.15.2-1quantal2) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)小智 44
以上都不适合我,所以我从/sf/ask/1126533201/复制答案
卸载旧的 R:
sudo apt-get remove r-base-core
Run Code Online (Sandbox Code Playgroud)
然后:
sudo add-apt-repository "deb http://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -sc)/"
Run Code Online (Sandbox Code Playgroud)
然后将这些命令复制/粘贴到命令行中:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base
Run Code Online (Sandbox Code Playgroud)
这对我有用
这是我如何做到的;
正如问题中已经提到的,我按照UBUNTU PACKAGES FOR R说明中的步骤添加存储库,并进行了 apt-get 更新,然后
apt-cache showpkg r-base
Run Code Online (Sandbox Code Playgroud)
这会给出类似的东西
Package: r-base
Versions:
3.0.2-1raring0 (/var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_raring_Packages)
Description Language:
File: /var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_raring_Packages
MD5: 5787ca79ed716232c4cc2087ed9b425b
3.0.1-6raring0 (/var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_raring_Packages)
Description Language:
File: /var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_raring_Packages
MD5: 5787ca79ed716232c4cc2087ed9b425b
Run Code Online (Sandbox Code Playgroud)
我做了一个
sudo apt-get install -f r-base=3.0.2-1raring0
Run Code Online (Sandbox Code Playgroud)
并做了。
打开终端并输入sudo -s. 然后source.list输入以下内容打开:
gedit /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)
然后,将这些行添加到文件中:
deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu quetzal/
Run Code Online (Sandbox Code Playgroud)
然后保存并退出gedit。在终端类型中
gpg --keyserver keyserver.ubuntu.com --recv-key E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9| sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)
然后输入
exit
Run Code Online (Sandbox Code Playgroud)
然后输入这些命令——一次一行——。
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
Run Code Online (Sandbox Code Playgroud)
在我的系统(未安装 R)中,该版本安装正确。因此,也许最好的选择是卸载旧的 R 并安装较新的版本,传递您想要的特定版本。但在此之前,请先备份操作系统。删除旧软件包后,重新安装它们可能会很困难。
另外请注意:如果您sudo apt-get install r-base=2.15.1-5ubuntu1这样做,将找不到软件包,因为版本错误。在该存储库中,文件被命名为例如r-base_2.15.2-1quantal2_all.deb,因此正确的版本应该是r-base=2.15.2-1quantal2或r-base=2.15.2-1quantal2_all。
希望这可以帮助。
| 归档时间: |
|
| 查看次数: |
143615 次 |
| 最近记录: |