1.2.3.1 Configuring Oracle Cloud Infrastructure Compute Instances for access to the regional yum server repositories

Compute instances in Oracle Cloud Infrastructure have access to regional yum servers via the service gateway. Regional yum servers on Oracle Cloud Infrastructure differ from the Oracle Linux yum server in that they also mirror content available on restricted ULN channels.

Yum repository configuration in Oracle Linux makes use of a yum variable in the baseurl for managing appropriate yum server access. For example, the baseurl to the ol8_baseos_latest repository for Oracle Linux 8 is:

baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch

The $ociregion variable can be set by populating content in /etc/dnf/vars/ociregion. If this file does not exist, or the file is empty, the baseurl is expanded to point to the publicly accessible Oracle Linux yum server. In the case of a typical Oracle Cloud Infrastructure compute instance, the value of variable is set when the instance is created so that the baseurl is expanded to point to the closest regional yum server on the Oracle Cloud Infrastructure service network. For example, if $ociregion is set to -phx, the baseurl expands to point to the regional yum server located in Phoenix.

By using variables, configuration can remain relatively standard across Oracle Linux deployments but provide access to the additional resources available to Oracle Cloud Infrastructure customers.