How to install R on Ubuntu 18.04 [Quick Start]

Introduction

R is an open source programming language specifically used for statistical calculations and graphics. In this tutorial, we will install R on an Ubuntu 18.04 server.

Preparation

An Ubuntu** server** with a non-root account that can use the sudo command has been set up, and the firewall has been turned on. Students who don’t have a server can buy it from here, but I personally recommend you to use the free Tencent Cloud Developer Lab for experimentation, and then buy server.

Step 1-Add GPG key

Log in to your Ubuntu 18.04 server as a sudo non-root user and add the relevant GPG key.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

Step 2-Add R Repository

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

If you are not using 18.04, please find the corresponding repository from the R Project Ubuntu list, named after each version.

Step 3-Update the package list

sudo apt update

Step 4-Install R

sudo apt install r-base

If prompted to confirm the installation, press y to continue.

Step 5-Test Installation

Start R's interactive shell as root.

sudo -i R

You should receive output similar to the following:

R version 3.5.1(2018-07-02)--"Feather Spray"Copyright(C)2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu(64-bit)...
Type 'demo()'for some demos,'help()'for on-line help, or
' help.start()'for an HTML browser interfaceto help.
Type 'q()' to quit R.
​
>

This confirms that we have successfully installed R and entered its interactive shell.

For more Ubuntu tutorials, please go to [Tencent Cloud + Community] (https://cloud.tencent.com/developer?from=10680) to learn more.

Reference: "How To Install R on Ubuntu 18.04 [Quickstart]"

Recommended Posts

How to install R on Ubuntu 18.04 [Quick Start]
How to install Git on Ubuntu 18.04 [Quick Start]
How to install Anaconda on Ubuntu 18.04 [Quick Start]
How to install R on Ubuntu 20.04
[Quick Start] How to install Apache web server on Ubuntu 18.04
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install R on CentOS 8
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to install Apache on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to install Zoom on Ubuntu 20.04
How to install Nginx on Ubuntu 16.04
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Postman on Ubuntu 18.04
How to install Go 1.6 on Ubuntu 16.04
How to install Go on Ubuntu 18.04
How to install MySQL on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 20.04
How to install VLC on Ubuntu 18.04
How to install TeamViewer on Ubuntu 20.04
How to install Webmin on Ubuntu 20.04
Install R4 on ubuntu20
How to install Docker Compose on Ubuntu 18.04
How to install Ubuntu on Raspberry Pi
How to install Bacula Server on Ubuntu 14.04