LoginSignup
13
5

More than 1 year has passed since last update.

OCI ComputeのYumリポジトリ構成を調べる & Oracle JDK, Graal VM EEのサブスクリプションが含まれる件

Last updated at Posted at 2019-07-01

1. はじめに

「Yumを使いこなす」ことは、Linuxを使いこなすうえで重要なことの1つだ。 そしてYum/RPMのコマンドを熟知するだけでなく、標準リポジトリに含まれていないパッケージを、どこから持ってくるかという知識も重要だ。

OCI Computeは、RHEL/CentOSと比べて標準で有効になっているリポジトリが多い。主要なリポジトリを説明する。

2. Yumリポジトリを確認する

現在有効になっているリポジトリはyum repolist enabledで確認できる。Oracle Linux 7と8では違うのでそれぞれ説明する。

2-1. Oracle Linux 7

~]# yum repolist enabled
Loaded plugins: langpacks, ulninfo
repo id                         repo name                                 status
ol7_MySQL80/x86_64              MySQL 8.0 for Oracle Linux 7 (x86_64)        213
ol7_UEKR6/x86_64                Latest Unbreakable Enterprise Kernel Rele    270
ol7_addons/x86_64               Oracle Linux 7Server Add ons (x86_64)        485
ol7_ksplice                     Ksplice for Oracle Linux 7Server (x86_64) 12,868
ol7_latest/x86_64               Oracle Linux 7Server Latest (x86_64)      22,179
ol7_oci_included/x86_64         Oracle Software for OCI users on Oracle L    855
ol7_optional_latest/x86_64      Oracle Linux 7Server Optional Latest (x86 16,052
ol7_software_collections/x86_64 Software Collection Library release 3.0 p 16,313
repolist: 69,235
disableになっているリポジトリも含めて全表示(クリックすると開く)
# yum repolist all
Loaded plugins: langpacks, ulninfo
repo id                         repo name                                                     status
ol7_MODRHCK/x86_64              Latest RHCK with fixes from Orac disabled
ol7_MySQL55/x86_64              MySQL 5.5 for Oracle Linux 7 (x8 disabled
ol7_MySQL56/x86_64              MySQL 5.6 for Oracle Linux 7 (x8 disabled
ol7_MySQL57/x86_64              MySQL 5.7 for Oracle Linux 7 (x8 disabled
ol7_MySQL80/x86_64              MySQL 8.0 for Oracle Linux 7 (x8 enabled:    213
ol7_UEKR3/x86_64                Latest Unbreakable Enterprise Ke disabled
ol7_UEKR3_OFED20/x86_64         OFED supporting tool packages fo disabled
ol7_UEKR4/x86_64                Latest Unbreakable Enterprise Ke disabled
ol7_UEKR4_OFED/x86_64           OFED supporting tool packages fo disabled
ol7_UEKR4_archive/x86_64        Unbreakable Enterprise Kernel Re disabled
ol7_UEKR5/x86_64                Latest Unbreakable Enterprise Ke disabled
ol7_UEKR5_RDMA/x86_64           Oracle Linux 7 UEK5 RDMA (x86_64 disabled
ol7_UEKR5_archive/x86_64        Unbreakable Enterprise Kernel Re disabled
ol7_UEKR6/x86_64                Latest Unbreakable Enterprise Ke enabled:    270
ol7_UEKR6_RDMA/x86_64           Oracle Linux 7 UEK6 RDMA (x86_64 disabled
ol7_addons/x86_64               Oracle Linux 7Server Add ons (x8 enabled:    485
ol7_developer/x86_64            Oracle Linux 7Server Development disabled
ol7_developer_EPEL/x86_64       Oracle Linux 7Server EPEL Packag disabled
ol7_developer_UEKR5/x86_64      Oracle Linux 7Server Unbreakable disabled
ol7_developer_UEKR6/x86_64      Developer Preview of UEK Release disabled
ol7_developer_kvm_utils/x86_64  Oracle Linux 7Server KVM Utiliti disabled
ol7_ksplice                     Ksplice for Oracle Linux 7Server enabled: 12,868
ol7_kvm_utils/x86_64            Oracle Linux 7Server KVM Utiliti disabled
ol7_latest/x86_64               Oracle Linux 7Server Latest (x86 enabled: 22,179
ol7_latest_archive/x86_64       Oracle Linux 7Server Latest (x86 disabled
ol7_oci_included/x86_64         Oracle Software for OCI users on enabled:    855
ol7_optional_archive/x86_64     Oracle Linux 7Server Optional (x disabled
ol7_optional_latest/x86_64      Oracle Linux 7Server Optional La enabled: 16,052
ol7_security_validation/x86_64  Oracle Linux 7Server (x86_64) Se disabled
ol7_software_collections/x86_64 Software Collection Library rele enabled: 16,313
ol7_u0_base/x86_64              Oracle Linux 7Server GA installa disabled
ol7_u1_base/x86_64              Oracle Linux 7Server Update 1 in disabled
ol7_u2_base/x86_64              Oracle Linux 7Server Update 2 in disabled
ol7_u3_base/x86_64              Oracle Linux 7Server Update 3 in disabled
ol7_u4_base/x86_64              Oracle Linux 7Server Update 4 in disabled
ol7_u5_base/x86_64              Oracle Linux 7Server Update 5 in disabled
ol7_u6_base/x86_64              Oracle Linux 7Server Update 6 in disabled
ol7_u7_base/x86_64              Oracle Linux 7Server Update 7 in disabled
ol7_u8_base/x86_64              Oracle Linux 7Server Update 8 in disabled
ol7_u9_base/x86_64              Oracle Linux 7Server Update 9 in disabled
ol7_x86_64_userspace_ksplice    Ksplice aware userspace packages disabled
repolist: 69,235

それぞれのリポジトリに含まれているパッケージは以下の通り。Oracle Linuxでは、ol7_latestol7_UEKR5が基本だろう。あとはRHEL系ディストリビューションでよく使用するEPELや、知っていると便利なol7_software_collectionsくらいは覚えておきたい。

リポジトリID 説明
ol7_latest 標準パッケージの最新版
ol7_UEKR6 UEKR6カーネル
ol7_addons DockerやKubernetes、Oracle VM Serverのテンプレート、OS Watcherなど
ol7_optional_latest オプショナル・パッケージ
ol7_ksplice ライブ・パッチング・システムKsplice
ol7_developer VirtualBoxやAnsible、Terraformなどの開発ツール
ol7_developer_EPEL FedoraプロジェクトによるEnterprise Linux向けパッケージ。デフォルト無効
ol7_software_collections 標準パッケージには含まれない新しいバージョンのパッケージ
ol7_ociyum_config, ol7_oci_included Oracle JDKやOracle XE、Oracleインスタント・クライアントなど。ol7_ociyum_configとol7_oci_includedは同じリポジトリ

ヒント
各リポジトリに含まれているパッケージを調べるには次のコマンドが便利だ。
yum --disablerepo=* --enablerepo=<調べたいリポジトリID> list available

2-2. Oracle Linux 8

~]# yum repolist enabled
repo id           repo name
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_addons        Oracle Linux 8 Addons (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
ol8_ksplice       Ksplice for Oracle Linux 8 (x86_64)
ol8_oci           Oracle Linux 8 OCI Packages (x86_64)
ol8_oci_included  Oracle Software for OCI users on Oracle Linux 8 (x86_64)
disableになっているリポジトリも含めて全表示(クリックすると開く)
# yum repolist all
repo id               repo name                                         status
ksplice-uptrack                Ksplice Uptrack for Oracle Linux         disabled
ol8_UEKR6                      Latest Unbreakable Enterprise Kernel Rel enabled
ol8_UEKR6_RDMA                 Oracle Linux 8 UEK6 RDMA (x86_64)        disabled
ol8_addons                     Oracle Linux 8 Addons (x86_64)           enabled
ol8_appstream                  Oracle Linux 8 Application Stream (x86_6 enabled
ol8_baseos_latest              Oracle Linux 8 BaseOS Latest (x86_64)    enabled
ol8_codeready_builder          Oracle Linux 8 CodeReady Builder (x86_64 disabled
ol8_developer                  Oracle Linux 8 Development Packages (x86 disabled
ol8_developer_EPEL             Oracle Linux 8 EPEL Packages for Develop disabled
ol8_developer_UEKR6            Developer Preview of UEK Release 6 (x86_ disabled
ol8_ksplice                    Ksplice for Oracle Linux 8 (x86_64)      enabled
ol8_kvm_appstream              Oracle Linux 8 KVM Application Stream (x disabled
ol8_oci                        Oracle Linux 8 OCI Packages (x86_64)     enabled
ol8_oci_included               Oracle Software for OCI users on Oracle  enabled
ol8_u0_baseos_base             Oracle Linux 8 BaseOS GA (x86_64)        disabled
ol8_u1_baseos_base             Oracle Linux 8.1 BaseOS (x86_64)         disabled
ol8_u2_baseos_base             Oracle Linux 8.2 BaseOS (x86_64)         disabled
ol8_x86_64_userspace_ksplice   Ksplice aware userspace packages for Ora disabled
リポジトリID 説明
ol8_UEKR6 UEKR6カーネル
ol8_addons PacemakerやOS Watcherなど
ol8_appstream AppStreamパッケージ
ol8_baseos_latest コアパッケージの最新版
ol8_ksplice ライブ・パッチング・システムKsplice
ol8_oci oci-utilsなど
ol8_oci_included Oracle JDKやOracle REST Data Services(ords)、OS Management Service Agent(osms-agent)など
ol8_developer TerraformやVSCode、OCI用Pythonライブラリなど開発で使用するパッケージ。デフォルト無効
ol8_developer_EPEL FedoraプロジェクトによるEnterprise Linux向けパッケージ。デフォルト無効

2-3. 参考リポジトリ情報

3. OCI用Yumリポジトリを理解する

OCI Computeで参照しているYumリポジトリと、オンプレミス用のYumリポジトリは違うことを知っているだろうか。

オンプレミス用YumリポジトリのFQDNはyum.oracle.comである。しかしOCI Computeで参照しているYumリポジトリは、リージョンごとに設置されたyum-tokyo.oracle.comやyum-phx.oracle.comだ。

repoファイルを確認すると、以下のように定義されている。

/etc/yum.repos.d/oracle-linux-ol7.repo
[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL7/latest/$basearch/

$ociregion$ocidomainは変数で、以下のコマンドで確認できる。つまり東京リージョンはyum-ap-tokyo-1.oracle.comを参照している。

$ cat /etc/yum/vars/ociregion
-ap-tokyo-1
$ cat /etc/yum/vars/ocidomain
oracle.com

オンプレミスでインストールしたOracle Linuxのrepoファイルもクラウドと同じ定義だ。しかし、$ociregionがNULLなのでyum.oracle.comを参照している。以前はpublic-yum.oracle.comと定義されていたこともあるが、yum.oracle.comの別名なので同じサーバーである。

そして覚えておくべきことが三つある。

  • OCI用のYumリポジトリは、OCI以外からはアクセスできない
  • OCI用のYumリポジトリは、Internet GW/NAT GW/Service GWからアクセスできる
  • OCI用のYumリポジトリだけで提供されているパッケージがある

オンプレミスからcurl https://yum-tokyo.oracle.comを実行すると、待ち状態になってアクセスできない。おそらくホワイトリスト制御が行われているのだろう。

またOracle JDKやOracleインスタントクライアント、Kspliceは、一般のOracle Linux Yumリポジトリでは提供されていない。

4. OCIにはOracle JDKのサポートが含まれる

今回書くことになったきっかけが、OCIのOracle JDKサポートだ。Oracle Java有償化問題のなか、OCIのサブスクリプションにはJavaのサポートも含まれる。それもyumで直接アップデートできる。

上記ブログでは、以下のようにoci-included-release-el7パッケージをインストールして、ol7_oci_includedリポジトリを有効にしている。

sudo yum install -y --enablerepo=ol7_ociyum_config oci-included-release-el7

しかし、少なくとも最新(2019/5)のoracle-linux-ol7.repoファイルでは不要だ。標準でol7_oci_includedリポジトリが含まれているからだ。

パッケージをリストすると、JDK/JREだけでなく、GraalVMやOracle XE、Oracle Instant Clientも含まれている。

# yum --disablerepo=* --enablerepo=ol7_oci_included list available
Loaded plugins: langpacks, ulninfo
Available Packages
graalvm19-ee-8.x86_64                     19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-devel.x86_64               19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-javascript.x86_64          19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-jdk.x86_64                 19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-jre.x86_64                 19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-jre-headless.x86_64        19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-libpolyglot.x86_64         19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-llvm.x86_64                19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-llvm-toolchain.x86_64      19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-native-image.x86_64        19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-nodejs.x86_64              19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-nodejs-devel.x86_64        19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-polyglot.x86_64            19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-python.x86_64              19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-python-devel.x86_64        19.3.0-1.el7          ol7_oci_included
graalvm19-ee-8-ruby.x86_64                19.3.0-1.el7          ol7_oci_included
jdk-11.0.3.x86_64                         2000:11.0.3-ga        ol7_oci_included
jdk-11.0.4.x86_64                         2000:11.0.4-ga        ol7_oci_included
jdk-11.0.5.x86_64                         2000:11.0.5-ga        ol7_oci_included
jdk-12.0.1.x86_64                         2000:12.0.1-ga        ol7_oci_included
jdk-12.0.2.x86_64                         2000:12.0.2-ga        ol7_oci_included
jdk-13.x86_64                             2000:13-ga            ol7_oci_included
jdk-13.0.1.x86_64                         2000:13.0.1-ga        ol7_oci_included
jdk1.8.x86_64                             2000:1.8.0_231-fcs    ol7_oci_included
jre-12.x86_64                             12.0.2-ga             ol7_oci_included
jre1.8.x86_64                             1.8.0_231-fcs         ol7_oci_included
oci-linux-config.noarch                   0.1-1.0.601.el7       ol7_oci_included
oracle-database-xe-18c.x86_64             1.0-1                 ol7_oci_included
oracle-instantclient12.2-basic.x86_64     12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-basiclite.x86_64 12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-devel.x86_64     12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-jdbc.x86_64      12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-odbc.x86_64      12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-precomp.x86_64   12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-sqlplus.x86_64   12.2.0.1.0-1          ol7_oci_included
oracle-instantclient12.2-tools.x86_64     12.2.0.1.0-1          ol7_oci_included
oracle-instantclient18.3-basic.x86_64     18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-basiclite.x86_64 18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-devel.x86_64     18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-jdbc.x86_64      18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-odbc.x86_64      18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-precomp.x86_64   18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-sqlplus.x86_64   18.3.0.0.0-1          ol7_oci_included
oracle-instantclient18.3-tools.x86_64     18.3.0.0.0-1          ol7_oci_included
oraclelinux-patchonly-release-el7.x86_64  1.0-1.el7             ol7_oci_included
osms-agent.x86_64                         0.0.1-444.el7         ol7_oci_included
sqlcl.noarch                              19.1.0.094.1619-1.el7 

なお、インスタンスの作成時期や種類によっては、有効なリポジトリはol7_oci_includedでは無くol7_ociyum_configのこともある。名前は違っても同じリポジトリなので、どちらを使用してもよい。

したがって、Oracle JDKをインストールしたければ、次のように実行すればよい。あとはブログの記事で紹介されているalternativesでバージョンを切り替えれば完璧。

# ol7_oci_includedもしくはol7_ociyum_configを有効化
yum-config-manager --enable ol7_oci_included
# JDKインストール
yum install jdk-12.0.1

5. OCIにはGraalVM EEのサポートが含まれる

先ほど見たリポジトリにGraalVMがあったように、JDKと同様にGraalVM Enterprise Editionのサポートが含まれる。

GraalVM Enterprise in Oracle Cloud Infrastructure

上記マニュアルページに書かれている、手動でダウンロードすることも、Yumリポジトリからセットアップすることも可能だ。

6. まとめ

  • Oracle LinuxのYumリポジトリを提供するサーバーは「yum.oracle.com」と「yum-<リージョン>.oracle.com」がある
  • 「yum.oracle.com」はどこからでもアクセスできるのに対し、「yum-<リージョン>.oracle.com」にアクセスできるのはOCIに限られる
  • OCIにはOracle JDKとGraalVM EEのサブスクリプションが含まれる
  • OCIにはKspliceのサブスクリプションが含まれる。Oracle Linuxはデフォルトで有効になっている。またCentOS/Ubuntuでも追加費用無しに利用できる。
リポジトリサーバー 概要 対応Gateway 制限事項
yum.oracle.com どこからでも認証無しにアクセス可能 Internet GW, NAT GW Oracle JDKやGraalVM、Kspliceなどは非提供
yum-<リージョン>.oracle.com OCIからアクセス可能 Internet GW, NAT GW, Service GW
13
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
5