Ubuntu16更新R的3.5版本

Ubuntu16更新R的3.5版本

R到3.5因为引入了Bioconductor version: Release (3.8),是一个破天荒地的改变,必须更新!

Ubuntu倒是很稳定,现在其实已经是Ubuntu18了。

deb https://cloud.r-project.org/bin/linux/ubuntu/ xenial-cran35/

首先删除系统自带旧版本的R

sudo apt-get --purge remove r-base
sudo apt-get --purge remove r-base-core
sudo apt-get --purge remove r-base-dev
# sudo apt-get remove -y 'r-cran-*'
# apt-get remove 会删除软件包而保留软件的配置文件
# apt-get purge 会同时清除软件包和软件的配置文件

比如我这里:

Removing r-recommended (3.3.3-1xenial0) ...

这个时候,之前的R包其实也需要同样的被清理

[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"

然后更新Ubuntu源文件

这里,不同Ubuntu系统有点不一样:

Edit /etc/apt/sources.list and add the line appropriate to your distribution of Ubuntu.

# 18.04
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
# 16.04
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/
# 14.04
deb https://cloud.r-project.org/bin/linux/ubuntu trusty-cran35/

我这里是 Ubuntu16

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

sudo apt-get update
sudo apt-get install r-base r-base-core r-base-dev
#
# To update any R libraries installed via APT.
#
sudo apt-get upgrade

当然,还需要安装一系列R包咯。

if (!requireNamespace("BiocManager", quietly = TRUE))
 install.packages("BiocManager")
BiocManager::install("Sushi", version = "3.8")

BiocManager::install(c('shiny','shinydashboard','stringr','DT','ggplot2'),ask = F,update = F)
BiocManager::install('shinyBS',ask = F,update = F)
BiocManager::install('shinyAce',ask = F,update = F)
BiocManager::install(c('knitr','rmarkdown','rmarkdown','cowplot','dplyr'),ask = F,update = F)
BiocManager::install('RMySQL',ask = F,update = F) 
BiocManager::install(c('tm','SnowballC','wordcloud','RColorBrewer'),ask = F,update = F)
BiocManager::install('nik01010/dashboardthemes')

Comments are closed.