Install R & RStudio on Ubuntu 20.04/19.04/18.04/16.04 ByJosphat Mutai-
Step 1: Update system
Like always, update system package index, and optionally upgrade all installed packages to latest.
sudo apt update
sudo apt -y upgrade
Step 2: Install R on Ubuntu / Debian
We need to install r-base package which contains the basic R functions that let you perform arithmetic operations and basic programming in R. Use the command below to install.
sudo apt -y install r-base
Step 3: Download and Install RStudio
Now visit the RStudio downloads page to grab the latest release of RStudio for Debian based Linux distributions.
As of this article update, the latest version is 1.2.1335.
--- Ubuntu 18.04 / Linux Mint 19 / Debian 10 ---
sudo apt -y install wget
wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.2.5042-amd64.deb
sudo apt install ./rstudio-1.2.5042-amd64.deb
--- Ubuntu 16.04 / Linux Mint 18 ---
sudo apt -y install wget
wget https://download1.rstudio.org/desktop/xenial/amd64/rstudio-1.2.5042-amd64.deb
sudo apt install ./rstudio-1.2.5042-amd64.deb
--- Debian 9+ ---
wget https://download1.rstudio.org/desktop/debian9/x86_64/rstudio-1.2.5042-amd64.deb
sudo apt install ./rstudio-1.2.5042-amd64.deb
If you encounter any dependency problems, run:
sudo apt -f install