当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : Yum优化,Fedora 8为例。
帖子发表于 : 2008-03-11 23:05 
头像

注册: 2007-10-06 23:37
帖子: 582
送出感谢: 0 次
接收感谢: 0 次
本人是菜鸟,也不是从事IT方面的工作。我这篇帖子,允许不经我同意就可以被转载、修改和再发布,呵呵。

我优化yum的知识,主要来源于以下2篇链接文章:
http://www.linuxsir.org/bbs/showthread.php?t=290570
http://www.linuxsir.org/bbs/showthread. ... light=axel
感谢wq1977、感谢亚森罗平、以及所有帖子里、帖子外出现的朋友。
我这篇的东西只是整理粘贴一下。要深入理解的同学,请详细看上面链接文章。

小提示:
1、axel是wq1977大侠开发的,国货哦。
2、另有shawn.p.huang大侠开发了一款中文输入法,目前在快速完善升级中,现已率先加入Fedora官方源,详情看这里:
http://www.linuxsir.org/bbs/thread320543.html
3、Fedora 9 将通过yum-presto插件实现差量下载,也就是说只下载旧包与新包的差异部分。效率几乎提升10倍。



以Fedora 8 、axel 1.0b 为例,以root权限操作,开始。
================================================
一、安装yum-fastestmirror
引用:
yum install yum-fastestmirror


二、安装axel
注:我目前遇到的bug是假如yum要下载10个文件,第6个就中止了,那么再运行yum命令时,需要10个都重新下载。但这时我会在axelget.conf中把enabled值修改临时禁用,免得重复劳动。
1、获得axelget.conf
引用:


2、获得axelget.py
引用:


3、获得axel源码和安装。
引用:
cd /usr/local/src
wget http://wilmer.gaast.net/downloads/axel-1.0b.tar.gz
tar zxvf axel-1.0b.tar.gz
cd axel-1.0b
./configure --i18n=1
make
make install


三、优化fedora.repo与fedora-updates.repo文件
官方的镜像列表
http://mirrors.fedoraproject.org/publiclist/Fedora/
优化前请做好备份。
引用:
tar jcvf MyReposBak.tar.bz2 /etc/yum.repo.d/
chmod 444 MyReposBak.tar.bz2


亚森罗平兄的fedora.repo文件的头一段:
代码:
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
baseurl= 
          http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirrors.cat.pdx.edu/fedora/linux/releases/$releasever/Everything/$basearch/os/         
          http://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/os/
          ftp://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/os/
          http://mirror.aarnet.edu.au/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirror.internode.on.net/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://gulus.usherbrooke.ca/pub/distro/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirror.karneval.cz/pub/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://sunsite.mff.cuni.cz/MIRRORS/fedora.redhat.com/linux/releases/$releasever/Everything/$basearch/os/
          http://ftp-stud.hs-esslingen.de/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://fedora.tu-chemnitz.de/pub/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://ftp.uni-bayreuth.de/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://ftp.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          ftp://ftp.free.fr/mirrors/fedora.redhat.com/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://limestone.uoregon.edu/ftp/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://fedora.mirror.iweb.ca/releases/$releasever/Everything/$basearch/os/
          ftp://ftp.cse.buffalo.edu/pub/Linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirror.cc.vt.edu/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirrors.tummy.com/pub/fedora.redhat.com/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirrors.kernel.org/fedora/releases/$releasever/Everything/$basearch/os/
          http://www.gtlib.gatech.edu/pub/fedora.redhat/linux/releases/$releasever/Everything/$basearch/os/
          http://ftp.linux.ncsu.edu/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/os/
          ftp://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/os/
          http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://ftp.rhnet.is/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
          http://mirror.pacific.net.au/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
         
         
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY


亚森罗平兄的fedora-updates.repo文件的头一段
代码:
[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
baseurl=
          http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
          http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/updates/$releasever/$basearch/
          http://mirrors.cat.pdx.edu/fedora/linux/updates/$releasever/$basearch/         
          http://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch/
          ftp://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch/
          http://mirror.aarnet.edu.au/pub/fedora/linux/updates/$releasever/$basearch/
          http://mirror.internode.on.net/pub/fedora/linux/updates/$releasever/$basearch/
          http://gulus.usherbrooke.ca/pub/distro/fedora/linux/updates/$releasever/$basearch/
          http://mirror.karneval.cz/pub/linux/fedora/linux/updates/$releasever/$basearch/
          http://sunsite.mff.cuni.cz/MIRRORS/fedora.redhat.com/linux/updates/$releasever/$basearch/
          http://ftp-stud.hs-esslingen.de/pub/fedora/linux/updates/$releasever/$basearch/
          http://fedora.tu-chemnitz.de/pub/linux/fedora/linux/updates/$releasever/$basearch/
          http://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/updates/$releasever/$basearch/
          http://ftp.uni-bayreuth.de/linux/fedora/linux/updates/$releasever/$basearch/
          http://ftp.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
          ftp://ftp.free.fr/mirrors/fedora.redhat.com/fedora/linux/updates/$releasever/$basearch/
          http://limestone.uoregon.edu/ftp/fedora/linux/updates/$releasever/$basearch/
          http://fedora.mirror.iweb.ca/updates/$releasever/$basearch/
          ftp://ftp.cse.buffalo.edu/pub/Linux/fedora/linux/updates/$releasever/$basearch/
          http://mirror.cc.vt.edu/pub/fedora/linux/updates/$releasever/$basearch/
          http://mirrors.tummy.com/pub/fedora.redhat.com/fedora/linux/updates/$releasever/$basearch/
          http://mirrors.kernel.org/fedora/updates/$releasever/$basearch/
          http://www.gtlib.gatech.edu/pub/fedora.redhat/linux/updates/$releasever/$basearch/
          http://ftp.linux.ncsu.edu/pub/fedora/linux/updates/$releasever/$basearch/
          http://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch/
          ftp://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch/
          http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora/linux/updates/$releasever/$basearch/
          http://ftp.rhnet.is/pub/fedora/linux/updates/$releasever/$basearch/
          http://mirror.pacific.net.au/linux/fedora/linux/updates/$releasever/$basearch/
         
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora



优化的方法是一个个域名ping,把最快的镜像放在上面。我优化后的(公网ADSL2M)平时可达80~130KB/s,快的时候可以达峰值180~210KB/s。根据使用经验,澳大利亚的源最稳定,但负担重,同步较慢;台湾省opensource.nchc.org.tw的源是ping不通的,但firefox打开速度却最快。一般以下3个源比较快,如果想临时禁用某个源可以在repo文件中前面加“#”号。
引用:
mirror.pacific.net.au
opensource.nchc.org.tw
ftp.iij.ad.jp



我的fedora.repo文件
代码:
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl= 
                     http://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/os/
           http://mirror.pacific.net.au/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
                http://opensource.nchc.org.tw/fedora/linux/releases/$releasever/Everything/$basearch/os/
                          http://mirrors.kernel.org/fedora/releases/$releasever/Everything/$basearch/os/
        http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
baseurl=
                     http://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/debug/
           http://mirror.pacific.net.au/linux/fedora/linux/releases/$releasever/Everything/$basearch/debug/
                http://opensource.nchc.org.tw/fedora/linux/releases/$releasever/Everything/$basearch/debug/
                          http://mirrors.kernel.org/fedora/releases/$releasever/Everything/$basearch/debug/
        http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
baseurl=
                     http://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/source/SRPMS/
           http://mirror.pacific.net.au/linux/fedora/linux/releases/$releasever/Everything/source/SRPMS/
                http://opensource.nchc.org.tw/fedora/linux/releases/$releasever/Everything/source/SRPMS/
                          http://mirrors.kernel.org/fedora/releases/$releasever/Everything/source/SRPMS/
        http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY


我的fedora-updates.repo文件
代码:
[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
baseurl=
                     http://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch/
           http://mirror.pacific.net.au/linux/fedora/linux/updates/$releasever/$basearch/
                http://opensource.nchc.org.tw/fedora/linux/updates/$releasever/$basearch/
                          http://mirrors.kernel.org/fedora/updates/$releasever/$basearch/
        http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug
failovermethod=priority
baseurl=
                     http://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch/debug/
           http://mirror.pacific.net.au/linux/fedora/linux/updates/$releasever/$basearch/debug/
                http://opensource.nchc.org.tw/fedora/linux/updates/$releasever/$basearch/debug/
                          http://mirrors.kernel.org/fedora/updates/$releasever/$basearch/debug/
        http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[updates-source]
name=Fedora $releasever - Updates Source
failovermethod=priority
baseurl=
                     http://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/SRPMS/
           http://mirror.pacific.net.au/linux/fedora/linux/updates/$releasever/SRPMS/
                http://opensource.nchc.org.tw/fedora/linux/updates/$releasever/SRPMS/
                          http://mirrors.kernel.org/fedora/updates/$releasever/SRPMS/
        http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora


还想省点力的话,附件里有我的repo文件,Fedora 8的,记得把你原有的备份

当你明白个中方法之后,还可以优化fedora-development.repo、fedora-updates-testing.repo等等。
如果当中有什么错误请指出,如果你悟出有什么更好的东西,请你于大家分享,谢谢。


附件:
fedora-updates.repo.tar.bz2 [618 Bytes]
被下载 19 次
fedora.repo.tar.bz2 [628 Bytes]
被下载 18 次
axel-1.0b.tar.gz [42.28 KiB]
被下载 17 次
页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2008-03-22 10:14 
头像

注册: 2007-10-06 23:37
帖子: 582
送出感谢: 0 次
接收感谢: 0 次
建议把澳洲源排在最顶。


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2008-03-29 11:04 

注册: 2007-08-09 18:51
帖子: 65
送出感谢: 0 次
接收感谢: 0 次
清华大学的源更快,是ftp://ftp3.tsinghua.edu.cn.建议你把这个也加进去。


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2008-03-31 23:06 
头像

注册: 2006-09-21 14:28
帖子: 2376
送出感谢: 0 次
接收感谢: 0 次
引用:
1、axel是wq1977大侠开发的,国货哦。


引用:
Alice ~ # eix axel
[U] net-misc/axel
Available versions: 1.0b 1.0b-r1 1.0b-r2 (~)1.1 {debug nls}
Installed versions: 1.0b(09:42:24 AM 02/25/2008)(-debug)
Homepage: http://axel.alioth.debian.org/
Description: light Unix download accelerator

Alice ~ #



没有调查,没有发言权。


_________________
http://lee.youxu.info/


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译