system: CentOS 6.6
two steps:
1.
mkdir /root/repo
cp /etc/yum.repos.d/* /root/repo/
rm -rf /etc/yum.repos.d/*
cp /root/repos/CentOS-Media.repo /etc/yum.repos.d/
vim Centos-Media.repo
change it to
baseurl=file:///media/CentOS/
gpgcheck=0
enabled=1
2.
mkdir /media/CentOS
mount /dev/sda1 /media/CentOS
yum clean all
yum list
时间: 2024-10-28 02:14:11