1. Mount the DVD or ISO
#mount -t cifs -o username=user,password=pass,domain=abc.com //servername/share /mnt
#mount /dev/cdrom /mnt
#mount -o ro,loop redhat.iso /mnt
2. Copy files
#mkdir -p /var/repo/rhel6
#cp -r /mnt/* /var/repo/rhel6/
#cd /var/repo/rhel6/Packages
#rpm -i createrepo...
#cd /var/repo
#createrepo .
3. Create file local.repo in /etc/yum.repos.d/
#cd /etc/yum.repos.d/
#touch local.repo
[local]
enabled=1
gpgcheck=0
name=Red Hat Linux $releasever - $basearch - DVD
baseurl=file:///var/repo
Save and exit
Try to install a package:
#yum install httpd
#mount -t cifs -o username=user,password=pass,domain=abc.com //servername/share /mnt
#mount /dev/cdrom /mnt
#mount -o ro,loop redhat.iso /mnt
2. Copy files
#mkdir -p /var/repo/rhel6
#cp -r /mnt/* /var/repo/rhel6/
#cd /var/repo/rhel6/Packages
#rpm -i createrepo...
#cd /var/repo
#createrepo .
3. Create file local.repo in /etc/yum.repos.d/
#cd /etc/yum.repos.d/
#touch local.repo
[local]
enabled=1
gpgcheck=0
name=Red Hat Linux $releasever - $basearch - DVD
baseurl=file:///var/repo
Save and exit
Try to install a package:
#yum install httpd
No comments:
Post a Comment