在Ubuntu界面下,快捷键Ctrl+Alt+T打开终端。输入命令:sudo
-s。回车,输入用户密码,将权限提升为root权限。
入命令:apt-get update。获取最新软件包信息。
使用命令:apt-get install r-base。自动安装R语言。
安装过程中,若出现选择提示,一律选择允许。安装完成后,输入R,出现如图所示的画面,安装成功。
安装扩展包(软件包)方法:首先输入命令R,进入R语言环境。然后输入命令install.packages("软件包名称"),回车。在弹出的HTTPS
CRAN中选择,China(Beijing4)[https]。选择后,会自动安装,静待即可。
接下来安装cummeRbund
biocLite("cummeRbund")
由于系统环境原因,有些文件没安装,如libxml2-dev
libcurl-dev,这些都是安装cummeRbund时需要提前配置的。由于错误可能很多,所以我选择先手动安装cummeRbund所需要的包。过程如下:
install.packages("RSQLite")
install.packages("ggplot2")
install.packages("plyr")
install.packages("fastcluster")
source("http://www.bioconductor.org/biocLite.R")
biocLite("rtracklayer")
biocLite("Gviz")
biocLite("BiocGenerics")
biocLite("cummeRbund")
如果出现以下错误:
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/usr/local/lib/R/site-library/XML’
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/usr/local/lib/R/site-library/RCurl’
ERROR: dependencies ‘XML’, ‘RCurl’ are not available for package
‘rtracklayer’
* removing ‘/usr/local/lib/R/site-library/rtracklayer’
The downloaded source packages are in
‘/tmp/RtmpM5a8Xe/downloaded_packages’
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘XML’ had non-zero exit
status
2: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘RCurl’ had non-zero
exit status
3: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘rtracklayer’ had
non-zero exit status
> q(0
+ )
Error in quit(save, status, runLast) :
one of "yes", "no", "ask" or "default"
expected.
RCurl和XML这两个包解决之后,其他基本就没有问题了.
具体解决步骤如下:
打开terminal终端运行以下命令,安装-dev包, 解决curl-config和xml-config的问题
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libxml2-dev
出现如下错误:
ERROR: configuration failed for package ‘openssl’
* removing
‘/home/ningxin/R/x86_64-pc-linux-gnu-library/3.4/openssl’
ERROR: dependency ‘openssl’ is not available for package
‘httr’
* removing
‘/home/ningxin/R/x86_64-pc-linux-gnu-library/3.4/httr’
ERROR: dependency ‘httr’ is not available for package
‘AnnotationHub’
* removing
‘/home/ningxin/R/x86_64-pc-linux-gnu-library/3.4/AnnotationHub’
ERROR: dependency ‘AnnotationHub’ is not available for package
‘ensembldb’
* removing
‘/home/ningxin/R/x86_64-pc-linux-gnu-library/3.4/ensembldb’
ERROR: dependency ‘ensembldb’ is not available for package
‘biovizBase’
* removing
‘/home/ningxin/R/x86_64-pc-linux-gnu-library/3.4/biovizBase’
ERROR: dependency ‘biovizBase’ is not available for package
‘Gviz’
* removing
‘/home/ningxin/R/x86_64-pc-linux-gnu-library/3.4/Gviz’
The downloaded source packages are in
‘/tmp/Rtmp8P29B2/downloaded_packages’
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘openssl’ had
non-zero exit status
2: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘httr’ had non-zero
exit status
3: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘AnnotationHub’ had
non-zero exit status
4: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘ensembldb’ had
non-zero exit status
5: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘biovizBase’ had
non-zero exit status
6: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘Gviz’ had non-zero
exit status
sudo apt-get install openssl
sudo apt-get install libssl-dev