3.2.1 Install Oracle R Distribution on Oracle Linux 8 Using Yum or Dnf

Oracle recommends using dnf to install Oracle R Distribution on Linux 8.

Yum simplifies the installation of Oracle R Distribution by automatically resolving RPM dependencies. If you install the RPMs directly, then you must resolve dependencies manually.

To install Oracle R Distribution on Oracle Linux 8 Using Yum or Dnf:

  1. Log in to the Linux server as root and change to the /etc/yum.repos.d directory:

    # cd /etc/yum.repos.d
  2. For Oracle Linux 8, in addition to the Oracle Linux 8 main repository, the appstream, codereadybuilder, and addons repositories are required. As root, create the repository /etc/yum.repos.d/oracle-linux-ol8.repo in a text editor and specify enabled=1 for ol8_baseos_latest, o18_appstream, o18_ codereadybuilder and ol8_addons:
    • Locate the section for baseos_latest repository and change enabled=0 to enabled=1.

      [ol8_baseos_latest]
      enabled=1
      [ol8_baseos_latest]
      name=Oracle Linux $releasever BaseOS ($basearch)
      baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=1

      The result will look similar like the following:

      [ol8_baseos_latest]
      name=Oracle Linux $releasever BaseOS ($basearch)
      baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=1
    • Locate the section for appstream repository and change enabled=0 to enabled=1.

      [ol8_appstream]
      enabled=1

      The result will look similar like the following:

      [ol8_appstream]
      name=Oracle Linux $releasever Application Stream ($basearch)
      baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/appstream/$basearch
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=1
    • Locate the section for codereadybuilder repository and change enabled=0 to enabled=1.

      [ol8_codereadybuilder]
      enabled=1

      The result will look similar like the following:

      [ol8_codereadybuilder]
      name=Oracle Linux $releasever Code Ready Builder ($basearch)
      baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/codeready/builder/$basearch
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=1
    • Locate the section for addons repository and change enabled=0 to enabled=1.

      [ol8_addons]
      enabled=1

      The result will look similar like the following:

      [ol8_addons]
      name=Oracle Linux $releasever Add ons ($basearch)
      baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/addons/$basearch/
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=1
  3. As root, install R-4.0.5 for Linux 8 using the dnf command. Run the dnf command to install R.
    # dnf install R-4.0.5
    .

Note:

In newer Oracle Linux versions, the yum package manager has been replaced by dnf package manager.