挂载CentOS5的ISO镜像
[[email protected] ~]# mount -t iso9660 /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[[email protected] mnt]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-Base.repo : 是网络源,默认使用,要想使用本地源的话,需要把这个文件名修改或者删除CentOS-Media.repo : 是本地源的配置
编辑 CentOS-Media.repo 文件:
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt/
file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=0
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
最后执行
[[email protected] yum.repos.d] yum clean all
[[email protected] yum.repos.d] yum makecache
测试配置是否成功
[[email protected] yum.repos.d] yum install samba
时间: 2024-10-28 23:56:14