yum 是Fedora中十分方便的软件包管理工具,但是其默认的源全是国外的站点上的,极大地影响了其下载资源的速度;因此应将其改为国内的镜像,清华大学的镜像站就是教育网内比较完善的镜像站点;建议教育网用户将yum源改为清华大学的镜像,极变态地提高下载速度。
具体操作如下(终端):
1. 获得root权限:
su
2. 将/etc/yum.repo.d改名;
mv /etc/yum.repo.d /etc/yum.repo.d~
若要还原该文件夹则输入:
mv /etc/yum.repo.d~ /etc/yum.repo.d
3.编辑/etc/yum.conf文件:
gedit /etc/yum.conf
将其改为:
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=RedHat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=0
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[extras]
name=Extras
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
enabled=1
[extras-source]
name=Extras
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/SRPMS/
enabled=1
[extras-debug]
name=Extras-debug
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/debug/
enabled=0
[extras-development]
name=Extras-development
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/$basearch/
enabled=0
[extras-development-debug]
name=Extras-development-debug
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/$releasever/debug/
enabled=0
[extras-development-source]
name=Extras-development-source
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/
enabled=0
[updates]
name=Updates
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch
enabled=1
[updates-source]
name=Updates-source
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/SRPMS
enabled=1
[updates-testing]
name=Updates-testing
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/$releasever/$basearch
enabled=0
[updates-testing-debug]
name=Updates-testing-debug
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/$releasever/$basearch/debug/
enabled=0
[updates-testing-source]
name=Updates-testing-source
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/$releasever/SRPMS
enabled=0
[core]
name=Core
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os
enable=1
[core-debug]
name=Core-debuginfo
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/debug/
enabled=0
[core-source]
name=Core-source
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/$releasever/source/SRPMS
enabled=1
[development]
name=Development
baseurl=http://mirror.anl.gov/pub/fedora-linux-core/development/$basearch/os
enabled=0
[development-debug]
name=Development-debug
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/$basearch/debug/
enabled=0
[development-source]
name=development-source
baseurl=http://mirror.anl.gov/pub/fedora-linux-core/development/source/SRPMS
enabled=0
[livna]
name=Livna
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/$releasever/$basearch/
enabled=1
[livna-debug]
name=livna-debug
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/$releasever/$basearch/debug
enabled=0
[livna-source]
name=Livna-source
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/$releasever/SRPMS/
enabled=1
[livna-development]
name=Livna-development
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/development/$basearch/
enabled=1
[livna-development-debug]
name=Livna-development-debug
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/development/$basearch/debug/
enabled=0
[livna-development-source]
name=Livna -development-source
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/development/SRPMS/
enabled=1
[livna-testing]
name=Livna-Testing
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/testing/$basearch/i386/
enabled=0
[livna-testing-debug]
name=Livna-testing-debug
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/testing/$basearch/i386/debug/
enabled=0
[livna-testing-source]
name=Livna-testing-source
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/testing/$basearch/SRPMS/
enabled=0
[freshrpms]
name=Freshrpms
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/freshrpms
enabled=1
[freshrpms-core]
name=Freshrpms-core
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/core
enabled=0
[freshrpms-extras]
name=Freshrpms-extras
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/extras
enabled=0
[freshrpms-updates]
name=Freshrpms-updates
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/updates
enabled=0
[freshrpms-tupdates]
name=Freshrpms-tupdates
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/tupdates
enabled=0
gedit /etc/yum.conf
将其改为:
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=RedHat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
这样就能使用清华大学的源了。
测试一下:
yum check-update
速度怎样!
非教育网用户请勿尝试