Enable YUM in OCI DBaaS Compute Instances

If you have some DBaaS computes nodes in your OCI, you will note that they don't come with any YUM repo configured by default. This is purposely architect to avoid you from installing or messing the system that you should be using "As a Service".

[root@db19c ~]# yum install swift
Loaded plugins: versionlock
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable custom repositories:
     yum-config-manager --enable <repo>
[root@db19c ~]# yum repolist all
Loaded plugins: versionlock
repolist: 0
[root@db19c ~]# cd /etc/yum.repos.d/
[root@db19c yum.repos.d]# ls -la
total 8
drwxr-xr-x  2 root root 4096 Apr  2  2020 .
drwxr-xr-x 83 root root 4096 Oct  3 08:05 ..
[root@db19c yum.repos.d]#

However, sometimes I need some flexibility to add some custom yum packages.

To do it, let's simply download the latest ol6 / ol7 / ol8 repo file to the yum folder as root.

First check your OS version.

[root@db19c yum.repos.d]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)

Now download the yum repo and the version lock file for your OS version.

Please note the versionlock file may be already present, so it's not recommended to replace it.

OL 7

  • wget -nv https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol7repo -O /etc/yum.repos.d/ol7.repo
  • wget -nv https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/versionlock_ol7.list -O /etc/yum/pluginconf.d/versionlock.list

OL 6

  • wget -nv https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol6repo -O /etc/yum.repos.d/ol6.repo
  • wget -nv https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/versionlock_ol6.list -O /etc/yum/pluginconf.d/versionlock.list

 

[root@db19c yum.repos.d]# wget -nv https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol7repo -O /etc/yum.repos.d/ol7.repo
2020-10-03 09:00:11 URL:https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol7repo [957/957] -> "/etc/yum.repos.d/ol7.repo" [1]
[root@db19c yum.repos.d]# ls -la
total 12
drwxr-xr-x  2 root root 4096 Oct  3 08:47 .
drwxr-xr-x 83 root root 4096 Oct  3 08:05 ..
-rw-r--r--  1 root root  957 Sep 23  2019 ol7.repo
[root@db19c yum.repos.d]# yum repolist all
Loaded plugins: versionlock
ol7_UEKR4                                                                                                                                                                            | 2.8 kB  00:00:00
ol7_UEKR4_archive                                                                                                                                                                    | 2.8 kB  00:00:00
ol7_latest                                                                                                                                                                           | 3.4 kB  00:00:00
ol7_latest_archive                                                                                                                                                                   | 2.8 kB  00:00:00
(1/9): ol7_UEKR4/x86_64/updateinfo                                                                                                                                                   |  84 kB  00:00:00
(2/9): ol7_latest/x86_64/group_gz                                                                                                                                                    | 134 kB  00:00:00
(3/9): ol7_UEKR4_archive/x86_64/updateinfo                                                                                                                                           | 253 kB  00:00:00
(4/9): ol7_latest/x86_64/updateinfo                                                                                                                                                  | 2.9 MB  00:00:00
(5/9): ol7_UEKR4/x86_64/primary_db                                                                                                                                                   | 5.2 MB  00:00:01
(6/9): ol7_latest_archive/x86_64/updateinfo                                                                                                                                          | 1.8 MB  00:00:00
(7/9): ol7_latest_archive/x86_64/primary_db                                                                                                                                          |  56 MB  00:00:02
(8/9): ol7_latest/x86_64/primary_db                                                                                                                                                  |  25 MB  00:00:02
(9/9): ol7_UEKR4_archive/x86_64/primary_db                                                                                                                                           |  87 MB  00:00:03
Excluding 31 updates due to versionlock (use "yum versionlock status" to show them)
repo id                                                        repo name                                                                                                                 status
ol7_UEKR4/x86_64                                               Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux 7Server (x86_64)                                          enabled:      131+9
ol7_UEKR4_archive/x86_64                                       Unbreakable Enterprise Kernel Release 4 for Oracle Linux 7Server (x86_64) - Archive                                       enabled:   1168+150
ol7_latest/x86_64                                              Oracle Linux 7Server Latest (x86_64)                                                                                      enabled:  19428+811
ol7_latest_archive/x86_64                                      Oracle Linux 7Server Latest (x86_64) - Archive                                                                            enabled: 24576+1211
repolist: 45303
[root@db19c yum.repos.d]#

That's it!

Have you enjoyed? Please leave a comment or give a 👍!

1 comment

    • Avinash on July 10, 2022 at 04:28
    • Reply

    Thanks this really helped me.

Leave a Reply

Your email address will not be published.