Rstudio and R source code install (20220105)
jsyu@Oreo:~$ sudo apt update
jsyu@Oreo:~$ sudo apt --fix-broken install
jsyu@Oreo:~$ sudo apt install xvfb xauth xfonts-base xorg-dev libtiff5 libtiff5-dev libcairo2 libghc-cairo-dev texlive-latex-base gsfonts-x11 t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi
jsyu@Oreo:~$ sudo apt install openssl libssl-dev xml2 libxml2-dev icu-devtools libicu-dev
For Ubuntu 18.04
jsyu@Oreo:~$ sudo apt install libreadline-dev libbz2-dev libpcre2 libpcre2-dev libpcre3-dev libpcre2-dev libcurl libcurl3 libcurl4 libcurl3-gnutls libcurl3-dev libcurl4-dev libcurl4-gnutls-dev libcurl4-doc libgnutls28-dev libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev texlive texlive-fonts-extra texlive-fonts-extra-doc html2ps texinfo libclang-dev
For Ubuntu 20.04
jsyu@Oreo:~$ sudo apt install libreadline-dev libbz2-dev libpcre2-dev libpcre3-dev libpcre2-dev libcurl3-gnutls libcurl3-dev libcurl4-doc libgnutls28-dev libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev texlive texlive-fonts-extra texlive-fonts-extra-doc html2ps texinfo libclang-dev libpq5
jsyu@Oreo:~$ sudo apt install openjdk-11-jre openjdk-11-jdk libblas-dev g++ gfortran libicu66 make aglfn git tk-dev liblapack-dev libopenblas-dev
Check https://www.rstudio.com/products/rstudio/download/#download for the newest version of source code of RStudio
jsyu@Oreo:~$ wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-2021.09.1-372-amd64.deb
jsyu@Oreo:~$ sudo dpkg -i rstudio-2021.09.1-372-amd64.deb
(Reading database ... 156559 files and directories currently installed.) Preparing to unpack rstudio-2021.09.1-372-amd64.deb ... Unpacking rstudio (2021.09.1+372) over (2021.09.1+372) ... dpkg: dependency problems prevent configuration of rstudio: rstudio depends on libclang-dev; however: Package libclang-dev is not installed. rstudio depends on libpq5; however: Package libpq5 is not installed. dpkg: error processing package rstudio (--install): dependency problems - leaving unconfigured Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for shared-mime-info (1.15-1) ... Errors were encountered while processing: rstudio |
Check dependency if installation failed. Install required packages and re-run
sudo dpkg -i rstudio-2021.09.1-372-amd64.deb
again.
Check https://cran.r-project.org/sources.html for the newest version of source code of R
jsyu@Oreo:~$ wget https://cran.r-project.org/src/base/R-4/R-4.1.2.tar.gz
jsyu@Oreo:~$ ls -al / | grep rwt
drwxrwxrwt 19 root root 4096 Dec 29 17:40 tmp
jsyu@Oreo:~$ tar zxvf R-4.1.2.tar.gz -C /tmp
jsyu@Oreo:/tmp/R-4.1.2$ cd /tmp/R-4.1.2
jsyu@Oreo:/tmp/R-4.1.2$ ./configure --prefix=/usr/local/R-4.1.2 --with-x --with-cairo --with-libtiff --with-libpng --with-jpeglib --enable-R-shlib --enable-BLAS-shlib
R is now configured for x86_64-pc-linux-gnu Source directory: . Installation directory: /usr/local/R-4.1.2 C compiler: gcc -g -O2 Fortran fixed-form compiler: gfortran -fno-optimize-sibling-calls -g -O2 Default C++ compiler: g++ -std=gnu++14 -g -O2 C++11 compiler: g++ -std=gnu++11 -g -O2 C++14 compiler: g++ -std=gnu++14 -g -O2 C++17 compiler: g++ -std=gnu++17 -g -O2 C++20 compiler: g++ -std=gnu++2a -g -O2 Fortran free-form compiler: gfortran -fno-optimize-sibling-calls -g -O2 Obj-C compiler: Interfaces supported: X11 External libraries: pcre2, readline, curl Additional capabilities: PNG, JPEG, TIFF, NLS, cairo Options enabled: shared R library, shared BLAS, R profiling Capabilities skipped: ICU Options not enabled: memory profiling Recommended packages: yes |
jsyu@Oreo:/tmp/R-4.1.2$ make -j 2 | tee make.log # starting 20:43–20:49
jsyu@Oreo:/tmp/R-4.1.2$ make -j 2 check | tee check.log # 20:50–20:54
jsyu@Oreo:/tmp/R-4.1.2$ sudo make install
jsyu@Oreo:/tmp/R-4.1.2$ sudo ln -s /usr/local/R-4.1.2/bin/R /usr/bin
jsyu@Oreo:/tmp/R-4.1.2$ sudo ln -s /usr/local/R-4.1.2/bin/Rscript \ /usr/bin
jsyu@Oreo:/tmp/R-4.1.2$ lscpu
Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 39 bits physical, 48 bits virtual CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 142 Model name: Intel(R) Core(TM) i3-8109U CPU @ 3.00GHz Stepping: 10 CPU MHz: 1128.259 CPU max MHz: 3600.0000 CPU min MHz: 400.0000 BogoMIPS: 6000.00 Virtualization: VT-x L1d cache: 64 KiB L1i cache: 64 KiB L2 cache: 512 KiB L3 cache: 4 MiB NUMA node0 CPU(s): 0-3 |
Under R (Command line interface, CLI)
jsyu@Oreo:/tmp/R-4.1.2$ sudo R # Install R packages for every user requires sudo
> sessionInfo()
R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.3 LTS Matrix products: default BLAS: /usr/local/R-4.1.2/lib/R/lib/libRblas.so LAPACK: /usr/local/R-4.1.2/lib/R/lib/libRlapack.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=lzh_TW LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=lzh_TW LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=lzh_TW LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_4.1.2 |
> capabilities()
jpeg png tiff tcltk X11 aqua TRUE TRUE TRUE FALSE TRUE FALSE http/ftp sockets libxml fifo cledit iconv TRUE TRUE TRUE TRUE TRUE TRUE NLS Rprof profmem cairo ICU long.double TRUE TRUE FALSE TRUE FALSE TRUE libcurl TRUE |
# See below for aligned terms with screen capture.
> install.packages('extrafont')
# Choose from source list [70] at https://cran.csie.ntu.edu.tw
> install.packages('ggplot2')
> install.packages("rJava")
> install.packages("xlsx") # Read and export to Excel and XML formats
> install.packages("gdata") # Read Excel file
> install.packages("devtools")
> install.packages("gplots")
> install.packages("cowplot")
> install.packages("RColorBrewer")
> install.packages("reshape2")
> install.packages("plyr")
> install.packages("ggpubr")
> install.packages("circlize")
> install.packages("magrittr")
> install.packages("org.Hs.eg.db") # Okay if fail, one of the following installs it too.
## Packages of R that have been utilized in our class this semester: ## Must run install.packages("devtools") first genefilter geneplotter DESeq2 tximportData tximport apeglm clusterProfiler enrichplot ChIPpeakAnno pathview ConsensusClusterPlus ComplexHeatmap org.Hs.eg.db ? |
# Install above components colored in teal
> devtools::install_bioc("genefilter")
> devtools::install_bioc("geneplotter")
> devtools::install_bioc("DESeq2")
> devtools::install_bioc("tximportData")
… …
> devtools::install_bioc("ComplexHeatmap")
> installed.packages()
# Check installed R packages
> library('xlsx','gdata')
> sessionInfo()
R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.3 LTS Matrix products: default BLAS: /usr/local/R-4.1.2/lib/R/lib/libRblas.so LAPACK: /usr/local/R-4.1.2/lib/R/lib/libRlapack.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=lzh_TW LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=lzh_TW LC_NAME=lzh_TW LC_ADDRESS=lzh_TW [10] LC_TELEPHONE=lzh_TW LC_MEASUREMENT=lzh_TW LC_IDENTIFICATION=lzh_TW attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] xlsx_0.6.5 rJava_1.0-6 loaded via a namespace (and not attached): [1] compiler_4.1.2 tools_4.1.2 xlsxjars_0.6.1 |
> q() # Quit R.
jsyu@Oreo:/tmp/R-4.1.2$ du -sh /usr/local/R-4.1.2/lib
2.0G /usr/local/R-4.1.2/lib
# All of the above-installed R packages took about 2GB of disk space.