Yum: add a local cdrom repository

From Define Wiki
Jump to navigation Jump to search

This is useful when you want to install packages from the local cdrom or .iso file

Tested on rhel 6.2

Mount the cdrom

This can be a locally attached cdrom or an iso file:

# Mount locally attached cdrom
mount /dev/cdrom /mnt/cdrom

# Mount iso file
mount -o loop filename-server-6.2.iso /mnt/cdrom

Create the .repo file

Create a file: /etc/yum.repos.d/cdrom.repo

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

Yum away!

Now you can run yum install against the packages on the DVD/CD