Monday, 7 May 2018

Create a Local Yum Repository Using an ISO Image on Exadata Database Machine

You want to install some packages on the Exadata Compute nodes running Oracle Enterprise Linux and you don't have internet access. In those cases you can create a local YUM repository using DVD Image. You simply download the DVD Image on the Desktop/Laptop where you have the internet access, copy it to the server and mount it.

In this article we will demonstrate how create a Local YUM Repository using ISO Image on Exadata Database Machines.

Prerequisites

  1. System with Internet
  2. Sufficient space on the server for Oracle Linux DVD ISO


Steps to create a Local YUM Repository using ISO Image on Exadata Database Machines

Step 1: Download Oracle Linux DVD Image from the Oracle Software Delivery Cloud at http://edelivery.oracle.com/linux

Here I am downloading:
V860937-01.iso Oracle Linux 6 Update 9 for x86 64 bit, 3.8 GB

Step 2: Copy the DVD image to the server to a staging directory using Winscp

Create a staging directory on the server

[root@dm01db01 ~]# mkdir -p /u01/app/oracle/software/ISO

Use Winscp to copy the ISO Image to the server

[root@dm01db01 ~]# ls -l /u01/app/oracle/software/ISO
total 3953672
-rw-r--r-- 1 root root 4048551936 Mar 20 04:18 V860937-01.iso

Step 3:  Create a mount point, for example /mnt/OEL6.9, and mount the DVD image on it. 

[root@dm01db01 ~]# mkdir -p /mnt/OEL6.9

[root@dm01db01 ~]# ls -l /mnt/OEL6.9
total 0

[root@dm01db01 ~]# mount -o loop,ro /u01/app/oracle/software/ISO/V860937-01.iso /mnt/OEL6.9

[root@dm01db01 ~]# df -h /mnt/OEL6.9
Filesystem            Size  Used Avail Use% Mounted on
/u01/app/oracle/software/ISO/V860937-01.iso
                      3.8G  3.8G     0 100% /mnt/OEL6.9

[root@dm01db01 ~]# cd /mnt/OEL6.9

[root@dm01db01 OEL6.9]# ls -l
total 1686
drwxr-xr-x 3 root root   2048 Mar 24  2017 EFI
-rw-r--r-- 1 root root   8529 Mar 24  2017 EULA
-rw-r--r-- 1 root root   8529 Mar 24  2017 eula.en_US
-rw-r--r-- 1 root root   3334 Mar 24  2017 eula.py
-rw-r--r-- 1 root root  18390 Mar 24  2017 GPL
drwxr-xr-x 3 root root   2048 Mar 24  2017 HighAvailability
drwxr-xr-x 3 root root   2048 Mar 24  2017 images
drwxr-xr-x 2 root root   2048 Mar 24  2017 isolinux
drwxr-xr-x 3 root root   2048 Mar 24  2017 LoadBalancer
-rw-r--r-- 1 root root     98 Mar 24  2017 media.repo
drwxr-xr-x 2 root root 716800 Mar 24  2017 Packages
-rw-r--r-- 1 root root   7193 Mar 24  2017 README-en
-rw-r--r-- 1 root root   6016 Mar 24  2017 README-en.html
-rw-r--r-- 1 root root  81004 Mar 24  2017 RELEASE-NOTES-en
-rw-r--r-- 1 root root 227548 Mar 24  2017 RELEASE-NOTES-en.html
-rw-r--r-- 1 root root  81004 Mar 24  2017 RELEASE-NOTES-x86_64-en
-rw-r--r-- 1 root root 227548 Mar 24  2017 RELEASE-NOTES-x86_64-en.html
-rw-r--r-- 1 root root  81004 Mar 24  2017 RELEASE-NOTES-x86-en
-rw-r--r-- 1 root root 227548 Mar 24  2017 RELEASE-NOTES-x86-en.html
lrwxrwxrwx 1 root root     15 Mar 24  2017 repodata -> Server/repodata
drwxr-xr-x 3 root root   2048 Mar 24  2017 ResilientStorage
-rw-r--r-- 1 root root   1011 Mar 24  2017 RPM-GPG-KEY
-rw-r--r-- 1 root root   1011 Mar 24  2017 RPM-GPG-KEY-oracle
drwxr-xr-x 3 root root   2048 Mar 24  2017 ScalableFileSystem
drwxr-xr-x 4 root root   2048 Mar 24  2017 Server
-rw-r--r-- 1 root root    108 Mar 24  2017 supportinfo
-r--r--r-- 1 root root   6517 Mar 24  2017 TRANS.TBL
drwxr-xr-x 3 root root   2048 Mar 24  2017 UEK4

Step 4:  Add an entry to the /etc/fstab file, this will to auto mount the DVD image after a reboot. 

/u01/app/oracle/software/ISO/V860937-01.iso /mnt/OEL6.9 iso9660 loop,ro 0 0

[root@dm01db01 ~]# vi /etc/fstab

[root@dm01db01 ~]# cat /etc/fstab
LABEL=DBSYS             /                       ext4    defaults        1 1
LABEL=BOOT              /boot                   ext4    defaults,nodev        1 1
LABEL=DBORA             /u01                    ext4    defaults,nodev  1 1
tmpfs                   /dev/shm                tmpfs   defaults,size=258341m 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP              swap                    swap    defaults        0 0
/u01/app/oracle/software/ISO/V860937-01.iso /mnt/OEL6.9 iso9660 loop,ro 0 0

Step 5:  Navigate to /etc/yum.repos.d directory, you can edit the existing repository files public-yum-ol6.repo or create a new repo file such as ULN-base.repo, and disable all entries by setting enabled=0. 

[root@dm01db01 ~]# cd /etc/yum.repos.d

[root@dm01db01 yum.repos.d]# ls -l
total 20
-rw-r----- 1 root root  291 Mar 31 22:43 Exadata-computenode.repo
-r--r----- 1 root root  896 Jan 26 06:19 Exadata-computenode.repo.sample
-rw-r--r-- 1 root root 7299 Mar 20 05:57 public-yum-ol6.repo

Here I am going to create the OL69.repo repository file and add the entries 

[root@dm01db01 yum.repos.d]# vi OL69.repo

[root@dm01db01 yum.repos.d]# cat OL69.repo
[OL69]
name=Oracle Linux 6.9 x86_64
baseurl=file:///mnt/OEL6.9
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
gpgcheck=1
enabled=1

Step 7:  Perform YUM Cache cleanup as below

[root@dm01db01 yum.repos.d]# yum clean all
Cleaning repos: OL69
Cleaning up Everything

Step 8:  Perform a test to ensure you can access yum repository

[root@dm01db01 yum.repos.d]# yum repolist
OL69                          | 3.7 kB      00:00 ...
OL69/primary_db                | 3.1 MB      00:00 ...
repo id                        repo name    status    
OL69                          Oracle Linux 6.9 x86_64 3,860
repolist: 3,860


Conclusion

In this article we have learned how to create local YUM repository using DVD ISO Image on Exadata Database Machine. Configuring a local YUM repository comes handy when you want to install packages on the server and you don't have internet access from the server.

No comments:

Post a Comment

Comparing Oracle Database Appliance X8-2 Model Family

September 2019 Oracle announced Oracle Database Appliance X8-2 (Small, Medium and HA). ODA X8-2 comes with more computing resources com...