以下 摘自 麦麦的不老阁 www.im321.com/blog/article.asp
在众多的Linux distribution中,由“Red Hat, Inc.”与开源社区合作发行的fedora,在Linux Desktop上的受欢迎程度是相当高的。fedora很好用,对硬件的支持相当度相当高,更关键的是有“Red Hat Inc.“的支持。但是,fedora fans最郁闷的事情莫过于源的问题了,在国内没有一个像样的镜像源,看着ubuntu fans 使用apt安装、更新的时候,速度是飞奔,而我们fedora fans使用yum的时候,看着蜗牛般下载速度,我们只有泪崩的份,相信YUM的速度问题,一直是fedorafans心中的痛吧!
我也是一直苦于yum蜗牛般速度,所以这几天搜集了一些速度相对快的源,重新制作了repo文件,使得yum的速度得到最大改善。顺便再一次来讨论这个让人泪崩的yum问题(YUM=Yellow Dog Updater,Modified),嘿嘿~
如果您要转摘此文章,请注明出处:YUM应用终极攻略-麦麦的不老阁
本文以fedora10发行版为例,如果使用的是低于10版本的,可能需要修改一些内容。
先以我系统中的yum.conf文件,说明一下大概的参数配置,很多文章都会说如何用YUM,但是很少见到说有如何配置yum.conf的。 引用内容[marco.chan@fedora~]$ cat /etc/yum.conf
[main]
cachedir=/var/cache/yum #yum下载的RPM包的缓存目录
keepcache=0 #缓存是否保存,1保存,0不保存。
debuglevel=2 #调试级别(0-10),默认为2(具体调试级别的应用,我也不了解)。
logfile=/var/log/yum.log #yum的日志文件所在的位置
exactarch=1 #在更新的时候,是否允许更新不同版本的RPM包,比如是否在i386上更新i686的RPM包。
obsoletes=1 #这是一个update的参数,具体请参阅yum(8),简单的说就是相当于upgrade,允许更新陈旧的RPM包。
gpgcheck=1 #是否检查GPG(GNU Private Guard),一种密钥方式签名。
plugins=1 #是否允许使用插件,默认是0不允许,但是我们一般会用yum-fastestmirror这个插件。
installonly_limit=3 #允许保留多少个内核包。
exclude=selinux* #屏蔽不想更新的RPM包,可用通配符,多个RPM包之间使用空格分离。
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE or IN separate files named file.repo
# in /etc/yum.repos.d
repo文件中的内容可以包含在yum.conf文件中,但是默认会放在/etc/yum.repos.d/这个目录下,方便编辑,也为了方便区分不同源的文件。
方法三、安装yum-presto。关于presto请连接
用 户只需要下载每一个软件的增量内容(用drpm打包而成),在本地计算机重新生成一个完整的软件包再安装。通常增量更新只有很小的下载量,因而即使很大量 的内容要更新,所耗费的时间必然比传统方法要少很多。不过presto系统还在测试之中,而且只有一个服务器提供presto更新,速度也不怎么样。目前presto只提供Fedora 9、Fedora 10和Fedora Rawhide三个版本的更新。 程序代码sudoyum -y install yum-presto 引用内容Installation
In Fedora, run "yum install yum-presto". Then enable a presto repository listed below.
Presto Repositories
To use presto in Fedora, you need to have some presto repositories enabled.
Easy setup:
The easy way (if you're running F9 or F10 (i386, x86_64)) is to change the mirrorlist
For F9, in /etc/yum.repos.d/fedora-updates-newkey.repo change the mirrorlist to:
mirrorlist=http://presto-mirrors.anmar.eu.org/mirrorlist?repo=updates-released-f$releasever.newkey&arch=$basearch
For F10, in /etc/yum.repos.d/fedora-updates.repo change the mirrorlist to:
mirrorlist=http://presto-mirrors.anmar.eu.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
Hard setup:
If you prefer to set the baseurl directly, use the following:
Fedora Rawhide:
To use the presto repository in Fedora Rawhide, you need to change your baseurl in /etc/yum.repos.d/fedora-rawhide.repoto point to the one below.
i386: baseurl=http://lesloueizeh.com/devel/i386/development
Fedora 10:
To use the presto repository in Fedora 10, you need to change your baseurl in /etc/yum.repos.d/fedora-updates.repoto point to the one below.
i386: baseurl=http://lesloueizeh.com/f10/i386/updates
x86_64: baseurl=http://dl.anmar.eu.org/repos/f10/updates-x86_64
A big thank you to Angel Marin for creating and hosting the x86_64 deltarpms for F10!
Fedora 9:
To use the presto repository in Fedora 9, you need to change your baseurl in /etc/yum.repos.d/fedora-updates-newkey.repoto point to the one below.
i386: baseurl=http://lesloueizeh.com/f9/i386/updates.newkey
x86_64: baseurl=http://dl.anmar.eu.org/repos/f9/updates-x86_64.newkey
A big thank you to Angel Marin for creating and hosting the x86_64 deltarpms for F9!
Releases:
Fedora 9, 10 and Rawhide