Ade Malsasa Akbar contact
Senior author, Open Source enthusiast.
Monday, July 11, 2022 at 16:29

This tutorial explains how you can install GNU R and RStudio (libre version) on Ubuntu. This applies to the OS version 22.04 and later as well as the older ones. R is the software environment for statistical computing & graphics from The GNU Project, an alternative to the proprietary S language. On the other hand, RStudio is a graphical program that allows users to use R in convenience and more. A combination of both is a strong free/libre open source replacement to SPSS. Finally, this article is a companion to our Libre SPSS Alternatives. Now let's install them.

Subscribe to UbuntuBuzz Telegram Channel to get article updates.

Download Page for GNU R

https://gnu.org/s/r 

Visiting this download page is not required to install GNU R. 



Download Page for RStudio 

https://rstudio.com/products/rstudio/download/

Visiting this page is required to install RStudio. You should find the package files in the table mentioned as "Ubuntu 22" or "Ubuntu 18+". 


Install GNU R

This installation method is universal for Ubuntu OS versions. 

Step 1. Install GNU R:

$ sudo apt-get install r-base

Step 2. Run it:

$ R
R version 4.1.2 (2021-11-01) -- "Bird Hippie"

Step 3. Alternatively, you can run R from applications menu.

 

Install RStudio for OS 22.04

Step 1. Download RStudio package for "Ubuntu 22" from RStudio page.

Step 2. You got a package file named rstudio-2022-xyz.deb.

Step 3. Access your directory from Terminal. 

Step 4. Install the package file using command line:

$ sudo dpkg -i rstudio-2022-xyz.deb

Step 5. You may get error messages so don't panic. 

Step 6. If there are error messages, do the command line:

$ sudo apt-get -f install

Step 7. RStudio installed.

Replace 2022 and xyz with the number of year and version of your own copy of RStudio package file.


Install RStudio for OS 20.04 and Earlier

The same as for OS 22.04 except instead download and install RStudio package for OS 18+. 

(RStudio running on Ubuntu Jammy)

 

That's all. 

Happy computing!



This article is licensed under CC BY-SA 3.0.