Installing latest version of R on the Ubuntu 20.04/18.04, and Linux Mint 19/20
To install the latest version of R on Ubuntu 20.04 Focal Fossa, or Linux Mint 20 Ulyana. Run the following commands:
$ sudo apt-key adv — keyserver keyserver.ubuntu.com — recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
After running the above command add the apt repository for the R as follows:
$ sudo add-apt-repository ‘deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/’
Once you’ve ran the above commands now it’s time to install the r-base and r-base-dev as follows:
$ sudo apt-get update
$ sudo apt-get install r-base r-base-dev
The above command will install the latest version of R (R 4.0.3 at the time of writing this blog) and use can test it by running R command and you should see the output something like this:
$ RR version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.Natural language support but running in an English localeR is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.>
To install R on Ubuntu 18.04 Bionic Beaver, or Linux Mint 19 Tara. Run the following commands:
$ sudo apt-key adv — keyserver keyserver.ubuntu.com — recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
$ sudo add-apt-repository ‘deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/’
$ sudo apt-get update
$ sudo apt-get install r-base r-base-dev
That’s it. You’ve successfully installed the latest version of R on Ubuntu and Linux Mint. If you are facing any issues write them in the comment section below.
Cheers!