Redhat本地源

虚拟机中配置Redhat本地源

1. 虚拟机加载ISO镜像,挂载


mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

2. 添加本地yum配置文件


rm -f /etc/yum.repos.d/rhel-source.repo
vi /etc/yum.repos.d/rhel-local.repo

3. 写入以下内容


[rhel-local]
name=Red Hat Enterprise Linux $releasever - $basearch - Local
baseurl=file:///mnt/cdrom/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

3. 设置开机自动挂载光驱


echo "/dev/cdrom /mnt/cdrom auto defaults 0 0" >> /etc/fstab

发表评论