安裝完Fedora20後,使用yum 更新安裝軟件總會出錯,網上給的解決方案不靠譜,最後自己用光盤作爲軟件源才解決了問題
具體方法如下:
1.綁定光驅
[root@localhost /]# cd mnt/
[root@localhost mnt]# mkdir fedora_dvd
[root@localhost mnt]# mount -t iso9660 /dev/sr0 fedora_dvd/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@localhost mnt]#
2.備份源
[root@localhost mnt]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
fedora-rawhide.repo fedora-updates.repo
fedora.repo fedora-updates-testing.repo
3.創建repo文件
vi /etc/yum.repos.d/Fedora.repo
文件內容
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=file:///mnt/fedora_dvd/
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
簡單的寫法:
vi /etc/yum.repos.d/iso.repo
文件內容
[iso]
name=iso //name 指的是更新源文件名,省略擴展名
baseurl=file:///mnt/fedora_dvd/
enable=1
gpgcheck=0
4.更新源
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache