Thursday, February 12, 2026

.::: Enable Repo Local Using cdrom (ISO file) on Centos 9, Almalinux 9, Redhat 9 :::.

 
 
1. check iso/disk/rom 

lsblk

[root@teguhth ~]# lsblk
NAME               MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0                 11:0    1 12.4G  0 rom
nvme0n1            259:0    0   30G  0 disk
+-nvme0n1p1        259:1    0    1G  0 part /boot
+-nvme0n1p2        259:2    0   29G  0 part
  +-almalinux-root 253:0    0   27G  0 lvm  /
  +-almalinux-swap 253:1    0    2G  0 lvm  [SWAP]
[root@teguhth ~]#

 
mount -o loop rhel-server-6.6-x86_64-dvd.iso /mnt
 2. create cdrom folder & mount 
mkdir -p /mnt/cdrom
mount /dev/sr0 /mnt/cdrom

[root@teguhth ~]# mkdir -p /mnt/cdrom
[root@teguhth ~]# mount /dev/sr0 /mnt/cdrom
mount: /mnt/cdrom: WARNING: source write-protected, mounted read-only.
[root@teguhth ~]# 

mount -o loop rhel-server-6.6-x86_64-dvd.iso /mnt
 
3. check disk mounting 

[root@teguhth ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
devtmpfs                    4.0M     0  4.0M   0% /dev
tmpfs                       838M     0  838M   0% /dev/shm
tmpfs                       335M  4.9M  331M   2% /run
/dev/mapper/almalinux-root   27G  1.7G   26G   7% /
/dev/nvme0n1p1              960M  251M  710M  27% /boot
tmpfs                       168M     0  168M   0% /run/user/0
/dev/sr0                     13G   13G     0 100% /mnt/cdrom
[root@teguhth ~]#
[root@teguhth ~]#

 
 


4. Enable repolocal
 
cat > /etc/yum.repos.d/local.repo << EOF
[BaseOS]
name=BaseOS
baseurl=file:///mnt/cdrom/BaseOS
enabled=1
gpgcheck=0

[AppStream]
name=AppStream
baseurl=file:///mnt/cdrom/AppStream
enabled=1
gpgcheck=0
EOF

[root@teguhth data]# cat /etc/yum.repos.d/local.repo
[BaseOS]
name=BaseOS
baseurl=file:///mnt/cdrom/BaseOS
enabled=1
gpgcheck=0

[AppStream]
name=AppStream
baseurl=file:///mnt/cdrom/AppStream
enabled=1
gpgcheck=0
[root@teguhth data]#
 

No comments:

Post a Comment

Popular Posts