主要是用于无法连接外网的CentOS6.5服务器
mkdir /mnt/cdrom
挂载光驱ISO文件
[[email protected]~]# mount /dev/cdrom /mnt/cdrom/
修改默认的源,修改前请先备份文件。
[[email protected] ~]# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
编辑yum文件
[[email protected] ~]# vim /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasver - Base
baseurl=file:///mnt/cdrom/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasver - Updates
baseurl=file:///mnt/cdrom/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
...
[[email protected] ~]# yum clean all (清除缓存)
[[email protected] ~]# yum makecache (建立新缓存)
就可以了的说
时间: 2024-11-01 10:53:28