CentOS:DVD安装yum源

来自WHY42

挂载DVD

首先挂载DVD:

mkdir -p /mnt/cdrom
mount -t iso9660 /dev/cdrom /mnt/cdrom/

然后增加yum源:

cd /etc/yum.repos.d/
vi /etc/yum.repos.d/dvd.repo

[RHEL]
name=RHEL7
baseurl=file:///mnt/cdrom
gpgcheck=0
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
enabled=1

安装软件

然后还要把其他的repo移走

yum install net-tools