GNU/Linux Ubuntu R Repository Adding
Hi! The Tutorial shows you Step-by-Step How to Add R Repository in Ubuntu 16.04+ GNU/Linux Based OSes.
And R for Ubuntu is a Free Software Environment for Statistical Computing and Graphics.
Especially relevant: only the Latest LTS Based Versions are fully supported.
So this Repo Setup is Valid for All the Ubuntu-based Distros like:
- Linux Mint
- Lubuntu
- Kubuntu
- Xubuntu
- Zorin OS
- Pop_OS!
- Elementary OS
- Kde Neon
- Linux Lite
- Bodhi Linux
- Q4OS
- Trisquel
- LXLE
- feren OS
- Peppermint
- Voyager Ubuntu
- Linux Ultimate Edition
Finally, the Guide include also instructions to Add CRAN Repository that contains more than 5000 R Packages.

1. Launching Terminal
How to QuickStart with Command Line on Ubuntu:
Here Console Ubuntu QuickStart GuideLink to Step-by-Step Guide on Getting Started with Command Line in Ubuntu3. Installing Dependencies
Then to Install Required Software
First, Update the Indices with:And then run:Copysudo apt update -qq
Authenticate with the User Admin Pass.Copysudo apt install --no-install-recommends software-properties-common dirmngr
If Got “User is Not in Sudoers file” then see: How to Enable sudo.4. Adding R GPG Key
Again to Add R GPG Signature Key
Do:Copywget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
5. Adding R Repo
Then to Add R Repository for Ubuntu
Execute:Authenticate with the User’s Admin Pass.Copysudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
If Got “User is Not in Sudoers file” then see: How to Enable sudo.
The $(lsb_release -cs) Command in the Repo Setup is outputting the Ubuntu Release.
So for the Derivative you have to amend the instruction Consequently, using the Ubuntu base.
For instance on Mint 20, Zorin OS 16, Elementary OS 6,… you have to use:Again, for the latest Ubuntu release you may have to amend the Repo manually.Copysudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/"
Using the nano Editor like:So for example you may have to change “impish” in “hirsute”.Copysudo nano /etc/sources.list.d/*-cran40.list
Ctrl+x to Save & Exit from nano Editor.
Last, update the Repository again as in the next Step.6. Refreshing Ubuntu Repo Sources
Next to Refresh Ubuntu Apt Repository Sources
Needed for most Ubuntu derivatives:Copysudo apt update
7. Adding CRAN PPA
Last, to Add CRAN Repository
Simply play:Copyadd-apt-repository ppa:c2d4u.team/c2d4u4.0+
Contents