教育網內Fedora源配置

此頁由 Linux Wiki用戶Chenxing 於 2012年12月18日 (星期二) 08:02 的最後更改。 在GadzikongU khO的工作基礎上。

出自Linux Wiki

提示:此文已超过 11 年(4140 天)未更新,如发现内容过时或有误,欢迎改进:)

教育網不能訪問國外,所以Fedora系統中默認的源用不了,本文以上海交大的源為例,介紹配置Fedora中yum源的方法。

Note.gif
注意:
Fedora 9在國內的源目前是不完整的,很多軟件包都沒有。如果你的學校支持IPv6,請使用IPv6的鏡像,如把ftp://ftp.sjtu.edu.cn/換成http://mirror.switch.ch/ftp/mirror/

首先,把當前的源配置文件備份。

# mkdir ~/repo.bak
# mv /etc/yum.repos.d/* ~/repo.bak
Note.gif
注意:
Fedora Core的幾個版本與Fedora 7(及其後的版本)軟件倉庫的路徑不一樣,故分別介紹。

Fedora 7(及其後名為Fedora的版本)

下面,以root權限創建、編輯 /etc/yum.repos.d/sjtu.repo

[updates]
name=Fedora updates
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/updates/$releasever/$basearch/
enabled=1
gpgcheck=0

[fedora]
name=Fedora $releasever - $basearch
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/releases/$releasever/Everything/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

如果需要使用freshrpms,還可以加上:

[freshrpms]
name=Fedora Core $releasever - $basearch - Freshrpms
baseurl=ftp://ftp.sjtu.edu.cn/freshrpms/ayo/fedora/linux/$releasever/$basearch/freshrpms/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms
gpgcheck=0

保存文件。

更新yum的緩存。

# yum makecache
Hint.gif
提示:
yum的更多使用方法請參照 yum

Fedora Core 6的配置方法

下面,以root權限創建、編輯 /etc/yum.repos.d/sjtu.repo

[freshrpms]
name=Freshrpms
baseurl=ftp://ftp.sjtu.edu.cn/freshrpms/ayo/fedora/linux/6/i386/freshrpms
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms
gpgcheck=0

 [core-sjtu]
name=core-sjtu
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/core/6/i386/os/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms
gpgcheck=0

[coreupdates-sjtu]
name=core-updates-sjtu
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/core/updates/6/i386
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms
gpgcheck=0

[extras-sjtu]
name=extras-sjtu
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/extras/6/i386
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=0

保存文件。

更新yum的緩存。

# yum makecache
Hint.gif
提示:
yum的更多使用方法請參照 yum

配置就這樣完成了。

本文对您有帮助?分享给更多朋友!

反馈与讨论

发现文档不全面、有错误却没时间编辑文档?想分享自己的经验或见解?欢迎在此留言、讨论。
简体繁体转换