mkdir -p /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
echo "mount /dev/cdrom /mnt/cdrom" >> /etc/rc.local
mkdir -p /etc/yum.repos.d/yumbak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/yumbak/
tee >>/etc/yum.repos.d/local.repo<<-eof
[CentOS6]
name=yumserver
baseurl=file:///mnt/cdrom
gpgcheck=1
enable=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
eof
yum clean all
yum update
yum makecache
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6(gpgcheck=0时无需配置)
时间: 2024-10-25 07:01:27