Installing R in CentOS Linux virtual server

Posted on

This is an article where the main content is for showing the R installation process. The installation itself is in a virtual server with the Linux CentOS as its operating system. This article actually has a main reference with the title of ‘How to Install R on CentOS 8’ in this link. The following is the process for the installation :

1. First of all, just logging in to the operating system. This article’s context is using virtual server for the R installation. Just logging in to the virtual server or using a remote method. For further reference, read the article with the title ‘How to Remote CentOS Virtual Server running in a VirtualBox with a NAT Network using SSH’ in this link to remote the virtual server using SSH.

2. After successfully logging in, install the epel-release repository. Execute the following command :

[root@10 ~]# dnf install epel-release
Last metadata expiration check: 1:14:11 ago on Thu 04 Mar 2021 02:50:00 AM EST.
Package epel-release-8-8.el8.noarch is already installed.
Dependencies resolved.
============================================================================================================================================================================ Package                                      Architecture                           Version                                     Repository                            Size
============================================================================================================================================================================Upgrading:
 epel-release                                 noarch                                 8-10.el8                                    epel                                  22 k
Transaction Summary
============================================================================================================================================================================Upgrade  1 Package
Total download size: 22 k
Is this ok [y/N]: y
Downloading Packages:
epel-release-8-10.el8.noarch.rpm                                                                                                             23 kB/s |  22 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------Total                                                                                                                                       9.0 kB/s |  22 kB     00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                    1/1
  Running scriptlet: epel-release-8-10.el8.noarch                                                                                                                                                                                       1/1
  Upgrading        : epel-release-8-10.el8.noarch                                                                                                                                                                                       1/2
  Cleanup          : epel-release-8-8.el8.noarch                                                                                                                                                                                        2/2
  Running scriptlet: epel-release-8-8.el8.noarch                                                                                                                                                                                        2/2
  Verifying        : epel-release-8-10.el8.noarch                                                                                                                                                                                       1/2
  Verifying        : epel-release-8-8.el8.noarch                                                                                                                                                                                        2/2
Upgraded:
  epel-release-8-10.el8.noarch
Complete!
[root@10 ~]#

2. Next step, after successfully installing the epel-release repository, execute the following command to enable the PowerTools :

[root@10 ~]# dnf config-manager --set-enabled PowerTools

3. Finally, execute the following command to install R :

[root@10 ~]# yum install R
CentOS-8 - PowerTools                                                                                                                                                                                       529 kB/s | 2.0 MB     00:03
Last metadata expiration check: 0:00:02 ago on Thu 04 Mar 2021 04:06:30 AM EST.
Dependencies resolved.
============================================================================================================================================================================================================================================
 Package                                                                Architecture                             Version                                                                 Repository                                    Size
============================================================================================================================================================================================================================================
Installing:
 R                                                                      x86_64                                   4.0.4-1.el8                                                             epel                                          37 k
Upgrading:
....
  urw-base35-p052-fonts-20170801-10.el8.noarch                                      urw-base35-standard-symbols-ps-fonts-20170801-10.el8.noarch                 urw-base35-z003-fonts-20170801-10.el8.noarch
  xdg-utils-1.1.2-5.el8.noarch                                                      xorg-x11-font-utils-1:7.5-40.el8.x86_64                                     xorg-x11-fonts-Type1-7.5-19.el8.noarch
  xorg-x11-proto-devel-2020.1-3.el8.noarch                                          xorg-x11-server-utils-7.7-27.el8.x86_64                                     xz-devel-5.2.4-3.el8.x86_64
  zziplib-0.13.68-8.el8.x86_64
Complete!
[root@10 ~]#

4. Last but not least, after successfully installing R, execute the following command to execute R and also check its version :

[root@10 ~]# R --version
R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
[root@10 ~]#

Leave a Reply