Tuesday, December 22, 2020

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@erptest04db ~]# yum install telnet
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@erptest04db ~]#

 

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@erptest04db ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)
[root@erptest04db ~]#
 

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@erptest04db ~]# wget -nv https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol7repo -O /etc/yum.repos.d/ol7.repo
2020-12-22 08:49:07 URL:https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol7repo [957/957] -> "/etc/yum.repos.d/ol7.repo" [1]
[root@erptest04db ~]# ls /etc/yum.repos.d/ol7.repo 


[root@erptest04db ~]# 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                                                                                                                                     |  86 kB  00:00:01
(2/9): ol7_latest/x86_64/group_gz                                                                                                                                      | 134 kB  00:00:01
(3/9): ol7_UEKR4_archive/x86_64/updateinfo                                                                                                                             | 253 kB  00:00:01
(4/9): ol7_latest_archive/x86_64/updateinfo                                                                                                                            | 1.8 MB  00:00:00
(5/9): ol7_latest/x86_64/updateinfo                                                                                                                                    | 3.1 MB  00:00:01
(6/9): ol7_UEKR4/x86_64/primary_db                                                                                                                                     | 4.6 MB  00:00:02
(7/9): ol7_latest/x86_64/primary_db                                                                                                                                    |  30 MB  00:00:02
(8/9): ol7_latest_archive/x86_64/primary_db                                                                                                                            |  56 MB  00:00:03
(9/9): ol7_UEKR4_archive/x86_64/primary_db                                                                                                                             |  87 MB  00:00:07
Excluding 171 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:      124+8
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:  21667+904
ol7_latest_archive/x86_64                               Oracle Linux 7Server Latest (x86_64) - Archive                                                                     enabled: 24576+1211
repolist: 47535

 

[root@erptest04db ~]# yum install telnet
Loaded plugins: versionlock
Excluding 171 updates due to versionlock (use "yum versionlock status" to show them)
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-66.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================
 Package                                    Arch                                       Version                                           Repository                                      Size
==============================================================================================================================================================================================
Installing:
 telnet                                     x86_64                                     1:0.17-66.el7                                     ol7_latest                                      64 k

Transaction Summary
==============================================================================================================================================================================================
Install  1 Package

Total download size: 64 k
Installed size: 113 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/telnet-0.17-66.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY==          ]  0.0 B/s |  55 kB  --:--:-- ETA
Public key for telnet-0.17-66.el7.x86_64.rpm is not installed
telnet-0.17-66.el7.x86_64.rpm                                                                                                                                          |  64 kB  00:00:01
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
 Package    : 7:oraclelinux-release-7.8-1.0.7.el7.x86_64 (@pdit_ol7_latest/$releasever)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : 1:telnet-0.17-66.el7.x86_64                                                                                                                                                1/1
  Verifying  : 1:telnet-0.17-66.el7.x86_64                                                                                                                                                1/1

Installed:
  telnet.x86_64 1:0.17-66.el7

Complete!
[root@erptest04db ~]#
 

That's it!

 

No comments:

Post a Comment

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...