1.掛載CentOS5的ISO鏡像到/mnt
網絡
- [root@server3 ~]# mount /dev/cdrom /mnt
- mount: block device /dev/cdrom is write-protected, mounting read-only
- [root@server3 mnt]# cd /etc/yum.repos.d/
- [root@server3 yum.repos.d]# ls
- CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-Base.repo : 是網絡源,默認使用,要想使用本地源的話,須要把這個文件名修改或者刪除ide
CentOS-Media.repo : 是本地源的配置
測試
2.編輯CentOS-Media.repo 這個文件:url
- [c5-media]
- name=CentOS-$releasever - Media
- baseurl=file:///mnt/
- # file:///media/cdrom/
- # file:///media/cdrecorder/
- gpgcheck=0
- enabled=1
- #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
3.最後執行:
spa
- [root@server3 yum.repos.d]# yum clean all
4.測試配置是否成功server
- [root@server3 yum.repos.d]# yum install samba