DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create an offline repository using DNF on RHEL 8 / CentOS 8.

1. Copy the RHEL DVD or Extract the ISO images to the desired location /mnt/rhel/dvd where you want to be kept.

2. Create the offline repository to its desired offline repository location

# vim /etc/yum.repos.d/server.repo

Add the given lines to it

name= server repo

When completes then save and exit using :wq

3. Clean the repository cache to enable the new offline repository

# dnf clean all

4. List the repository that you have recently added as a offline repository

# dnf repolist

5. Install any example packages

# dnf install httpd

6. Reinstall any example package

# dnf reinstall httpd

7. List of available packages

# dnf list all

8. Search the example packages

# dnf search httpd

9. Upgrade all the installed packages

# dnf upgrade

10. Individual example package information

# dnf info httpd

11. Install the group of example packages

# dnf group install mariadb

12.  Information about group of example packages

# dnf group info mariadb

13. Remove the example package

# dnf remove httpd

14.  Remove the group of example packages

# dnf group remove mariadb

15. Listing the old transaction

# dnf history list

16. Listing the particular example transaction

# dnf history list mariadb

Main DNF configuration file is /etc/dnf/dnf.conf

Congratulation now you have enabled the offline repository on your RHEL 8 / CentOS 8.