ubuntu下升级R版本

时间:2022-06-16 22:55:38

ubuntu下升级R版本

在测试《机器学习 实用案例解析》一书的邮件分类代码时,windows系统下rstudio中无法读取特殊字符,在ubuntu下可以。在ubuntu虚拟机下安装tm包(install.packages("tm"))时,提示R版本过低(需要3.1,但是只有3.0,最新版本是3.2),百度了下,网上的资料说,需要配置下/etc/apt/sources.list文件,即下载列表,包括R官方网站给出的方法也是如此。这些资料和R官网的说明地址如下:

http://blog.fens.me/r-install-ubuntu/

http://my.oschina.net/explore/blog/102481

https://cran.r-project.org/

但是按照上面的说明尝试,却遇到错误:

The following packages have unmet dependencies: r-base : Depends: r-base-core (>= 3.2.2-1quantal0) but it is not going to be installed Depends: r-recommended (= 3.2.2-1quantal0) 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.

以“ubuntu 升级r版本”为关键字百度,始终没有找到解决办法。

以“ubuntu 更新r版本 the following packages have unmet dependencies r-base-core”为关键字搜索,找到*上面的一个帖子(http://*.com/questions/15260250/re-installing-r-linux-ubuntu-unmet-dependencies-r),其中提到的解决方法是:

Try this

If you have added a line from new ubuntu repository to /etc/apt/sources.list, erase the line. Then, run the commands

sudo add-apt-repository ppa:marutter/rrutter 
sudo apt-get update 
sudo apt-get upgrade

It worked for me, the answer comes from here http://r.789695.n4.nabble.com/Upgrading-on-Ubuntu-from-2-11-1-to-2-15-1-td4636965.html

问题解决,R版本升级到3.2.2,安装tm,ggplot2包成功。