Install Ubuntu 20.04 lts and R 4.0.1 and Rstudio 1.3
# Install Ubuntu 20.04 lts
# 2 hours
sudo apt install update-manager-core
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo reboot
sudo do-release-upgrade -d
# Remove old R installation
# If you want install again your packages, follow this trick
# https://biostatsr.blogspot.com/2019/05/reinstall-packages-after-updating-r.html
sudo vi /etc/apt/sources.list
# Remove all lines with CRAN or r-project
# In vi, use / to search
# Remove files shown using:
ls /etc/apt/sources.list.d
# For example:
sudo rm /etc/apt/sources.list.d/marutter-ubuntu-rrutter3_5-xenial.list
sudo rm /etc/apt/sources.list.d/marutter-ubuntu-rrutter3_5-xenial.list.distUpgrade
sudo rm /etc/apt/sources.list.d/marutter-ubuntu-rrutter3_5-xenial.list.save
# I am not sure that reboot is necessary, but better to do!
sudo reboot
sudo apt-get purge r-base* r-recommended r-cran-*
sudo apt autoremove
sudo apt update
# Packages are located in .libPaths() read from R
# Example
# > .libPaths()
# [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
# [3] "/usr/lib/R/library"
sudo rm -rf /usr/local/lib/R/
sudo rm -rf /usr/lib/R
# Install new R version
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt update
sudo apt install r-base r-base-core r-recommended r-base-dev
sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+
sudo apt update
# Take a look at https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+?field.series_filter=focal
sudo apt install r-cran-rgl r-cran-rjags r-cran-snow r-cran-ggplot2 r-cran-igraph r-cran-lme4 r-cran-rjava r-cran-devtools r-cran-roxygen2 r-cran-rjava
sudo apt install libgdal-dev libproj-dev libgeos-dev libudunits2-dev libnode-dev libcairo2-dev libnetcdf-dev
# Install Rstudio 1.3
rstudio-server stop
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.3.959-amd64.deb
sudo gdebi rstudio-server-1.3.959-amd64.deb
rm rstudio-server-1.3.959-amd64.deb
# To allow a user to use /usr/local/lib/R/site-library
sudo usermod -a -G staff $USER
# 2 hours
sudo apt install update-manager-core
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo reboot
sudo do-release-upgrade -d
# Remove old R installation
# If you want install again your packages, follow this trick
# https://biostatsr.blogspot.com/2019/05/reinstall-packages-after-updating-r.html
sudo vi /etc/apt/sources.list
# Remove all lines with CRAN or r-project
# In vi, use / to search
# Remove files shown using:
ls /etc/apt/sources.list.d
# For example:
sudo rm /etc/apt/sources.list.d/marutter-ubuntu-rrutter3_5-xenial.list
sudo rm /etc/apt/sources.list.d/marutter-ubuntu-rrutter3_5-xenial.list.distUpgrade
sudo rm /etc/apt/sources.list.d/marutter-ubuntu-rrutter3_5-xenial.list.save
# I am not sure that reboot is necessary, but better to do!
sudo reboot
sudo apt-get purge r-base* r-recommended r-cran-*
sudo apt autoremove
sudo apt update
# Packages are located in .libPaths() read from R
# Example
# > .libPaths()
# [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
# [3] "/usr/lib/R/library"
sudo rm -rf /usr/local/lib/R/
sudo rm -rf /usr/lib/R
# Install new R version
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt update
sudo apt install r-base r-base-core r-recommended r-base-dev
sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+
sudo apt update
# Take a look at https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+?field.series_filter=focal
sudo apt install r-cran-rgl r-cran-rjags r-cran-snow r-cran-ggplot2 r-cran-igraph r-cran-lme4 r-cran-rjava r-cran-devtools r-cran-roxygen2 r-cran-rjava
sudo apt install libgdal-dev libproj-dev libgeos-dev libudunits2-dev libnode-dev libcairo2-dev libnetcdf-dev
# Install Rstudio 1.3
rstudio-server stop
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.3.959-amd64.deb
sudo gdebi rstudio-server-1.3.959-amd64.deb
rm rstudio-server-1.3.959-amd64.deb
# To allow a user to use /usr/local/lib/R/site-library
sudo usermod -a -G staff $USER
Commentaires
Enregistrer un commentaire