歡迎您光臨本站 註冊首頁

yum設置

←手機掃碼閱讀     火星人 @ 2014-03-23 , reply:0

剛裝了FC6,由於在教育網,無法使用yum默認的國外更新源,因此需要將其設置為國內鏡像站點。在網上找了一圈,發現清華的 ftp://ftp3.tsinghua.edu.cn這個更新源不錯。參考網上的一些方法,設置yum更新源步驟如下:

1. 將/etc/yum.repos.d/下的已有更新源(repo文件)的enable改為0。為了方便起見,可以直接 mv /etc/yum.repos.d /etc/yum.repos.d.bak重命名,這樣就讓系統找不到原有的repo文件了。

2. 修改/etc/yum.conf文件,添加如下內容:
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

[extras]
name=Fedora Extras $releasever - $basearch
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/6/i386
enabled=1

[updates]
name=Fedora Core $releasever - $basearch - Updates
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/6/i386
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[core]
name=Fedora Core $releasever - $basearch
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os
enable=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

3. 經過上述步驟后,就可以使用速度較快的國內鏡像站點作為yum更新源了。

後記:在使用yum進行install時,經常會出現下面的錯誤
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1ac70ce6
導致安裝不能進行。解決方法如下:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

[火星人 ] yum設置已經有342次圍觀

http://coctec.com/docs/linux/show-post-121518.html