How to install Rstudio & R-base Ubuntu 20.04 LTS Linux

RStudio is a development environment platform created for developers who are interested in the statistical programming language R. The platform is available in both open-source and commercial editions, of course, the feature difference will be there. The paid version will have more extensive features as compared to the open-source one.

Here we are installing the non-commercial version of Rstudion on Ubuntu 20.4 which can be upgraded to a commercial one. The software offers an editor with syntax highlighting, console, and direct code execution. Whereas those are running the CLI server they can use the Rstudio Server or RStudio Server Pro to access it via a web browser.

Few Rstudio features:

  • Built-in IDE
  • Workspace browser and data viewer
  • Interactive debugger
  • Use Source editor to directly execute the code
  • Cross-platform, support Windows, macOS, and Linux.
  • Integrated support for Git and Subversion
  • Syntax highlighting
  • Auto code completion
  • Smart indentation

And more…

Easy Steps to install Rstudio on Ubuntu 20.04 LTS

Add gpg key and R-base repository

To add the repository for install R-base on Ubuntu first we need to add the key so that system can verify the packages we are about to download, is from a genuine source.

sudo apt-key adv --keyserver --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository "deb focal-cran40/"

Update the system

Next, run the system update command to ensure all packages are up to date and to rebuild the repo cache.

sudo apt update

Install R-base package

Without the R-base package, the RStudio will not work on Ubuntu 20.04 or earlier version of Linux, it is a package that contains basic R-functions needed by the platform to perform various arithmetic operating while programing.

sudo apt install r-base

Install Gdebi

For setting up this development platform we will use gdebi package manager that will automatically install the required dependencies.

sudo apt-get install gdebi-core

Download Rstudio Debian Package

Go to the official website for the Rstudio and then click on the Ubuntu/Debian Linux .deb package available to download.

Download Rstudio Debian package on Ubuntu 20.4

Install Rstudio on Ubuntu Linux

It doesn’t matter you are on Ubuntu 20.04 or 19.04/18.04 the steps of installing it will be the same. Therefore, switch to the Downloads directory as whatever we download from the browser goes to this folder.

cd Downloads

See the files:


Use dpkg command:

sudo gdebi filename

Replace filename with the downloaded Rstudio package.

For example,

sudo gdebi rstudio-1.3.1093-amd64.deb

Run Rstudio

Go to Applications and you will find the Rstudio icon, click on it to run.

Command to setup Rstuio and R base on Ubuntu 20.04 or 18.04

Additional tip

After setting up the R-base, you can install Rstudio on any Linux system such as CentOS, Ubuntu, and other supported ones using the quick installation command that is

bash -c "$(curl -L"

However, make sure the curl is there on your system. Moreover, you can visit the GitHub page of this project to know more about it and other installation methods of Rstudio supported by various other Linux OS.


One Response

  1. Ino Wright July 3, 2021

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.