Fedora安装完毕之后最头疼的问题就是软件更新,因为Fedora默认的更新源服务器是在国外,所以每次更新的速度奇慢!那么,我们是否 可以修改Fedora的默认下载源呢?答案是可以的。目前国内有很多大学都提供了Fedora的更新包下载服务器,下载速度相对国外的快。下面以华中科技 大学的源()为例(只能用在Fedora15、16、17,强烈建议在修改默认的下载源时候,先 备份/etc/yum.repos.d/fedora.repo和/etc/yum.repos.d/fedora-updates.repo。 比如:cp /etc/yum.repos.d/fedora.repo 、/home/wyp/fedora.repo.bak)。
第一步:删除/etc/yum.repos.d下的所以文件,上面谈到了自己最好去备份,万一自己弄错了,可以恢复嘛。
rm -rf /etc/yum.repos.d/*第二步:将以下保存为 fedora-ustc.repo
[fedora]name=Fedora $releasever - $basearch - ustc
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug - ustc
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/releases/$releasever/Everything/$basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[fedora-source]
name=Fedora $releasever - Source - ustc
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/releases/$releasever/Everything/source/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
第三步:将以下保存为 fedora-updates-ustc.repo
[updates]name=Fedora $releasever - $basearch - Updates - ustc
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/updates/$releasever/$basearch/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug -ustc
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/updates/$releasever/$basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[updates-source]
name=Fedora $releasever - Updates Source - ustc
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/updates/$releasever/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
第四步:将 fedora-ustc.repo和 fedora-updates-ustc.repo放入/etc/yum.repos.d/中
第五步:运行sudo yum clean all和sudo yum makecache(当然,你是root用户就不要价sudo了)
共0条 [查看全部]相关评论