rhel7配置本地yum源


#!/bin/bash

umount /dev/sr0
mount /dev/sr0 /mnt/

mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.backup
cat > /etc/yum.repos.d/rhel7.repo <<EOF
[base-rhel7]
name=base-rhel7
baseurl=file:///mnt
enabled=1
gpgcheck=0
EOF

yum clean all

yum list