How to Create Local HTTP Yum/DNF Repository on OEL 8

Create Folders for Copy of packages from ISO to local drive

[root@Dm01db08 oracle]# mkdir -p /oracle/repo
[root@Dm01db08 Packages]# mkdir -p /oracle/AppStream

now move the ISO location : You will get 2 folders in iso file

1) BaseOS

2) AppStream

Now copy the content of BaseOs to /oracle/repo

[root@Dm01db08 Packages]# pwd
/run/media/root/OL-8-2-0-BaseOS-x86_64/BaseOS/Packages

[root@Dm01db08 Packages]# cp * /oracle/repo/

Now copy the content of AppStream to /oracle/AppStream

[root@Dm01db08 Packages]# pwd
/run/media/root/OL-8-2-0-BaseOS-x86_64/AppStream/Packages

[root@Dm01db08 Packages]# cp * /oracle/AppStream

After copy is completed : Move to /etc/yum.repo.d

[root@Dm01db08 etc]# cd /etc/yum.repos.d/
[root@Dm01db08 yum.repos.d]#
[root@Dm01db08 yum.repos.d]#
[root@Dm01db08 yum.repos.d]# pwd
/etc/yum.repos.d
[root@Dm01db08 yum.repos.d]# ls -ltr
total 8
-rw-r--r--. 1 root root 1565 Apr 29 00:35 oracle-linux-ol8.repo
-rw-r--r--. 1 root root 470 Apr 30 00:23 uek-ol8.repo

Move both the file with some other name as _old for both files

[root@Dm01db08 yum.repos.d]# mv oracle-linux-ol8.repo oracle-linux-ol8.repo_old
[root@Dm01db08 yum.repos.d]# mv uek-ol8.repo uek-ol8.repo_old


[root@Dm01db08 yum.repos.d]# vi oellab.repo

[oellabrepo]
name=oellabrepo
baseurl=file:///oracle/repo
enabled=1
gpgcheck=0


[oellabrepo]
name=oellabrepo
baseurl=file:///oracle/AppStream
enabled=1
gpgcheck=0


[root@Dm01db08 Packages]# rpm -ivh drpm-0.4.1-1.el8.x86_64.rpm
warning: drpm-0.4.1-1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:drpm-0.4.1-1.el8 ################################# [100%]
[root@Dm01db08 Packages]#
[root@Dm01db08 Packages]#
[root@Dm01db08 Packages]# rpm -ivh createrepo_c-libs-0.15.1-2.el8.x86_64.rpm
warning: createrepo_c-libs-0.15.1-2.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:createrepo_c-libs-0.15.1-2.el8 ################################# [100%]


[root@Dm01db08 Packages]# rpm -ivh createrepo_c-0.15.1-2.el8.x86_64.rpm
warning: createrepo_c-0.15.1-2.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:createrepo_c-0.15.1-2.el8 ################################# [100%]
[root@Dm01db08 Packages]#
[root@Dm01db08 Packages]#


[root@Dm01db08 Packages]# createrepo /oracle/repo
Directory walk started
Directory walk done - 1683 packages
Temporary output repo path: /oracle/repo/.repodata/
Preparing sqlite DBs
Pool started (with 5 workers)
Pool finished


[root@Dm01db08 Packages]# createrepo /oracle/AppStream/
Directory walk started
Directory walk done - 5338 packages
Temporary output repo path: /oracle/AppStream/.repodata/
Preparing sqlite DBs
Pool started (with 5 workers)
Pool finished


[root@Dm01db08 Packages]# dnf repolist
repo id repo name
oellabrepo oellabrepo


[root@Dm01db08 Packages]# dnf install ksh -y
Last metadata expiration check: 0:01:09 ago on Fri 15 May 2020 02:40:38 AM IST.
Dependencies resolved.
===============================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================
Installing:
ksh x86_64 20120801-254.0.1.el8 oellabrepo 927 k

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

Total size: 927 k
Installed size: 3.2 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : ksh-20120801-254.0.1.el8.x86_64 1/1
Running scriptlet: ksh-20120801-254.0.1.el8.x86_64 1/1
Verifying : ksh-20120801-254.0.1.el8.x86_64 1/1

Installed:
ksh-20120801-254.0.1.el8.x86_64

Complete!

YUM -DNF config for Oracle Linux 8 - completes here (Hope This Helps)

Previous
Next Post »

1 comments:

Click here for comments
Unknown
admin
May 25, 2020 at 1:10 PM ×

Great

Congrats bro Unknown you got PERTAMAX...! hehehehe...
Reply
avatar