How to create local repository distributed through apache on AlmaLinux 8 using DVD ISO

repo creation via ISO DVD image that can be used by local server only

  • Mount the AlmaLinux DVD ISO file to /mnt/iso as the yum destination.

mkdir -p /mnt/iso

mount -o loop AlmaLinux-dvd.iso /mnt/iso

  • If you are using cdrom/dvdrom, insert cd/dvd and mount it to /mnt/iso as the yum destination.

mkdir -p /mnt/iso

mount -o loop -t iso9660 /dev/sr0 /mnt/iso

  • Create a yum repo file on the server in destination /etc/yum.repos.d/dvd.repo

vi /etc/yum.repos.d/BaseOS.repo
[BaseOS]
name=AlmaLinux 8.0 BaseOS
baseurl=file:///mnt/iso/BaseOS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-release

vi /etc/yum.repos.d/AppStream.repo
[AppStream]
name=AlmaLinux 8.0 AppStream
baseurl=file:///mnt/iso/AppStream/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-release

apache (httpd) based yum repository, which can be used by local server and network server

  • Mount AlmaLinux 8/Centos 8 DVD as follows:

mount -o loop almaLinux8-dvd.iso /mnt

  • Copy all data to /var/www/html/ or to a local directory:

shopt -s dotglob

cp -avRpf /mnt/* /var/www/html/

  • create .repo for clients as follows:

cat /etc/yum.repos.d/BaseOS.repo
[BaseOS]
name=AlmaLinux 8.0 BaseOS
enabled=1
gpgcheck=1
baseurl=http://<Server-IP>/BaseOS/

cat /etc/yum.repos.d/AppStream.repo
[AppStream]
name=AlmaLinux 8.0 AppStream
enabled=1
gpgcheck=1
baseurl=http://<Server-IP>/AppStream/

  • Clean existing yum/dnf cache and update repository lists on client servers as follows:

dnf clean all
rm -rf /var/cache/yum/*
dnf makecache
dnf repolist

Leave a Reply

Your email address will not be published. Required fields are marked *