Hello Everyone, In this tutorial, we are going to discuss and learn about how to install R on Ubuntu 16.04 version in easy and practical version. As of now, Ubuntu comes with version 18.04 also but still there are so many users are using Ubuntu 14.04 as well as Ubuntu 16.04.
If you are using Ubuntu 14.04 version, then check this article Install R on Ubuntu 14.04.
Before jump to the installation process, let’s get a simple introduction about R programming language and Ubuntu.
Introduction to Ubuntu
- Ubuntu is a free and open source operating system and Linux distribution based on Debian.
- Ubuntu is offered in three official editions: Ubuntu Desktop for personal computers, Ubuntu Server for servers.
- I personally love Ubuntu because Ubuntu comes with so very easy to use and effective interface and easy to learn too.
- As mentioned above, currently Ubuntu comes with version 18.04 as well as Ubuntu is using by so many organization who worked in IoT, Servers etc.
- If you want to know more about Ubuntu, then you can visit the Ubuntu Official Website.
Introduction to R Programming
- R is a popular open source programming language.
- R is used in Data Science, Data Analysis, Statistics computing and graphics and many more sectors.
- R is widely used by statisticians for developing statistical software and performing data analysis.
- R is highly and easily extensible by allowing users to author and submit their own packages.
- The best part about R is R community which is very big and very attentive to read to help and resolve your doubts in case if you have any confusion in any concept about R.
- If you want to know more about R programming, then you can visit the R official Website.
Now the time came to know about steps as of how to install R on Ubuntu 16.04 version.
Install R on Ubuntu 16.04 Version
- Ubuntu 16.04 version should be available.
- sudo access given to non-root users.
Step 1 – Add Ubuntu Trusty in the APT repository
First, we need to add Ubuntu Trusty location to Ubuntu APT repository to make sure, Ubuntu apt command can able to grab ubuntu version and able to download directly into Ubuntu 16.04.
For adding ubuntu trusty in apt repository, use below command:-
$ sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
Step 2 – Add Public Key
After successfully adding Ubuntu trusty link, we need to add a public key which will validate the R and make it sure to authenticate. Adding Public key, execute below command.
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Finally, your apt is ready to install R using apt-get command.
Step 3 – Update Ubuntu APT
As we make changes to sources. list file, so it’s better to update once to make sure all changes have to reflect correctly. For updating, please execute below command.
$ sudo apt-get update
Step 4 – Install R
Everything is set up and now you are ready to install R into Ubuntu 14.04 version. For installing purpose, please execute below command.
$ sudo apt-get install r-base
This command will install R seamlessly into your ubuntu 16.04 version. Congratulation on your successful installation.
Step 5 – Start R
Once installation will be done, then you can execute R command to get R command prompt to make sure you can write R codes.
For starting, please execute below code.
$ sudo -i R
I hope, you learn how to install R on Ubuntu version 16.04. In case of any confusion, you can comment down and I will try my best to reply as soon as possible.
For other tutorials, related to R programming, please visit my website