
[main]
cachedir=/var/cache/yum #yum下載的RPM包的緩存目錄
keepcache=0 #緩存是否保存,1保存,0不保存。
debuglevel=2 #調(diào)試級別(0-10),默認(rèn)為2(具體調(diào)試級別的應(yīng)用,我也不了解)。
logfile=/var/log/yum.log #yum的日志文件所在的位置
exactarch=1 #在更新的時候,是否允許更新不同版本的RPM包,比如是否在i386上更新i686的RPM包。
obsoletes=1 #這是一個update的參數(shù),具體請參閱yum(8),簡單的說就是相當(dāng)于upgrade,允許更新陳舊的RPM包。
gpgcheck=1 #是否檢查GPG(GNU Private Guard),一種密鑰方式簽名。
plugins=1 #是否允許使用插件,默認(rèn)是0不允許,但是我們一般會用yum-fastestmirror這個插件。
installonly_limit=3 #允許保留多少個內(nèi)核包。
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文件詳解
什么是repo文件?
repo文件是Fedora中
yum源(
軟件倉庫)的
配置文件,通常一個repo文件定義了一個或者多個軟件倉庫的
細(xì)節(jié)內(nèi)容,例如我們將從哪里下載需要
安裝或者升級的軟件包,repo文件中的設(shè)置內(nèi)容將被yum讀取和應(yīng)用!
我們以一份系統(tǒng)自帶的repo文件做為實例來探討(#號后面是我加的注釋):
[fedora] #方括號里面的是軟件源的名稱,將被yum取得并識別
name=Fedora $releasever - $basearch #這里也定義了軟件 倉庫的名稱,通常是為了方便閱讀配置文件,一般沒什么作用,$releasever變量定義了發(fā)行版本,通常是8,9,10等數(shù)字,$basearch變 量定義了系統(tǒng)的架構(gòu),可以是i386、x86_64、ppc等值,這兩個變量根據(jù)當(dāng)前系統(tǒng)的版本架構(gòu)不同而有不同的取值,這可以方便yum升級的時候選擇 適合當(dāng)前系統(tǒng)的軟件包,以下同……
failovermethod=priority #failovermethod 有兩個值可以選擇,priority是默認(rèn)值,表示從列出的baseurl中順序選擇鏡像服務(wù)器地址,roundrobin表示在列出的服務(wù)器中隨機(jī)選擇
exclude=compiz* *compiz* fusion-icon* #exclude這個選項是后來我自己加上去的,用來禁止這個軟件倉庫中的某些軟件包的安裝和更新,可以使用通配符,并以空格分隔,可以視情況需要自行添加
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
#上面的一行baseurl第一個字符是'#'表示該行已經(jīng)被注釋,將不會被讀取,這一行的意思是指定一個baseurl(源的鏡像服務(wù)器地址)
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
#上面的這一行是指定一個鏡像服務(wù)器的地址列表,通常是開啟的,本例中加了注釋符號禁用了,我們可以試試,將$releasever和$basearch替換成自己對應(yīng)的版本和架構(gòu),例如10和i386,在瀏覽器中打開,我們就能看到一長串鏡可用的鏡像服務(wù)器地址列表。
選擇自己訪問速度較快的鏡像服務(wù)器地址復(fù)制并粘貼到repo文件中,我們就能獲得較快的更新速度了,格式如下baseurl所示:
baseurl=
ftp://ftp.sfc.wide.ad.jp/pub/Linux/Fedora/releases/10/Everything/i386/os
http://ftp.chg.ru/pub/Linux/fedora/linux/releases/10/Everything/i386/os
http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora/linux/releases/10/Everything/i386/os
http://mirror.nus.edu.sg/fedora/releases/10/Everything/i386/os
http://mirror.yandex.ru/fedora/linux/releases/10/Everything/i386/os
http://ftp.twaren.net/Linux/Fedora/linux/releases/10/Everything/i386/os
http://ftp.itu.edu.tr/Mirror/Fedora/linux/releases/10/Everything/i386/os
enabled=1 #這個選項表示這個repo中定義的源是啟用的,0為禁用
gpgcheck=1 #這個選項表示這個repo中下載的rpm將進(jìn)行g(shù)pg的校驗,已確定rpm包的來源是有效和安全的
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch #定義用于校驗的gpg密鑰
##以下的軟件倉庫基本上用不到,選項含義同上
[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=http://download.fedoraproject.org/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-$basearch
[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedoraproject.org/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-$basearch
以上轉(zhuǎn)載自:
http://hi.baidu.com/%CE%AA%B0%AExxx/blog/item/ba40f75157f8ec878c54308d.html
另外,關(guān)于yum的選項可以man一下:
List of Commands:

check-update 檢查可提供的包升級
clean 刪除緩存數(shù)據(jù)
deplist 列出包依賴相關(guān)
erase 移除一個或多個包從你的系統(tǒng)
groupinfo 顯示關(guān)于包組的細(xì)節(jié)
groupinstall 從組里安裝軟件包到你的系統(tǒng)
grouplist 列出當(dāng)前的組
groupremove 在一個組中移除包從您的系統(tǒng)
help 顯示幫助用法信息
info 顯示關(guān)于包或一組包的細(xì)節(jié)信息
install 安裝一個或多個軟件包在你的系統(tǒng)
list 列出一個包或某組的包
localinstall 安裝本地 RPM
makecache 生成原數(shù)據(jù)緩存
provides Find what package provides the given value
reinstall 重新安裝一個包
repolist 顯示軟件倉庫的配置
resolvedep 決定哪個包提供了給定的依賴
search 查找包細(xì)節(jié)居給定的字符串
shell 運(yùn)行交互式的yum shell
update 更新一個或多個包在你的系統(tǒng)
upgrade Update packages taking obsoletes into account
Options:
-h, --help show this help message and exit
-t, --tolerant be tolerant of errors
-C 從緩沖中運(yùn)行,而不是升級緩存
-c [config file] config file location
-R [minutes] 最大化的命令等待時間
-d [debug level] 調(diào)試輸出級別
--showduplicates 顯示復(fù)制, 在repo,list/search命令下
-e [error level] 錯誤輸出級別
-q, --quiet 安靜的操作
-v, --verbose verbose operation
-y 回答所有的問題為是
--version 顯示 YUM版本信息并退出
--installroot=[path] 設(shè)置為root安裝
--enablerepo=[repo] 激活一個或多個倉庫(支持通配符)
--disablerepo=[repo] 禁掉一個或多個倉庫(支持通配符)
-x [package], --exclude=[package] 在名稱或glob不包含包。
--disableexcludes=[repo] disable exclude from main, for a repo or for everything
--obsoletes enable obsoletes processing during updates
--noplugins 禁掉yum插件
--nogpgcheck 禁掉GPG驗證檢查
--disableplugin=[plugin] 用名稱禁掉插件
--enableplugin=[plugin] enable plugins by name
--skip-broken 忽略包的依賴問題
--color=COLOR control whether color is used

yum配置:
1.Fedora10添加上海交大源:
創(chuàng)建一個sjtu.repo文件并把如下內(nèi)容復(fù)制進(jìn)去并保存:
[Fedora-ftp.sjtu.edu.cn]
name=Fedora 10 - i386
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/10/Fedora/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[Everything-ftp.sjtu.edu.cn]
name=Everything 10 - i386
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/10/Everything/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[updates-ftp.sjtu.edu.cn]
name=Fedora updates
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/updates/10/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
然后把文件: sjtu.repo
放在 /etc/yum.repos.d 的目錄中
然后在終端運(yùn)行:
2.安裝axel
最簡單的方法是下載rpm包,分別下載axel和yum-axelget到本地,然后執(zhí)行:
yum –nogpgcheck localinstall axel-2.3.1.fc10.i386.rpm
yum –nogpgcheck localinstall yum-axelget-.0-0.2.20080705.fc10.noarch.rpm
這樣axel就下載完成了,它可以使在下載時將一個文件或者包,分成10份同時進(jìn)行下載。
3.安裝最快鏡像插件
yum install yum-fastestmirror
4.安裝加速插件
這個插件為Fedora用戶提供更快,更小的下載量,它只下載 rpm 安裝包中被更新的部分,而不是整個rpm 包。加速插件被計劃包含在Fedora11中。要安裝,請輸入:
然后編輯 /etc/yum.repos.d/fedora-updates.repo 文件
gedit /etc/yum.repos.d/fedora-updates.repo
將
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
這一行注釋掉(在前加上#),然后在其下,加上這樣一行:
mirrorlist=http://presto-mirrors.anmar.eu.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
保存退出即可。
5.在下載時偶爾會出現(xiàn)它的最快鏡像插件選擇不對的情況,如果比較著急的話可以在它下載的時候感覺進(jìn)度條半天沒動或者剩余時間還有很長的時候選擇中斷這個源的下載,ctrl+C,然后yum會自動開始從別的源去下載更新。
以上文章轉(zhuǎn)自:
http://www.fedora.cc/index.php/2009/04/fedora-10-yum-peizhi/
打造實用之Fedora 10 ,Fedora 10安裝后實用配置
本人使用的是Fedora 10 x86_64位版!所以X86_64位版為例。
一、安裝第三方軟件源:
Fedora 8, 9 or 10:
su -c 'rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
注:(RPM Fusion 已經(jīng)正式啟動。簡單的說,RPM Fusion 是為 Fedora 及 Red Hat Enterprise Linux 用戶提供的一個軟件包倉庫。各位 Fedora/RHEL 朋友要是想要安裝的軟件在官方的倉庫中找不到,不要泄氣,興許通過 RPM Fusion 你就找到了。新啟動的 RPM Fusion 合并了原有的 Dribble、Freshrpms、Livna 等軟件包倉庫,將成為最大的第三方軟件包倉庫。通過 RPM Fusion 軟件包倉庫,你將找到 ATI/NVIDIA 顯卡驅(qū)動、私有的音頻/視頻編碼/解碼器、游戲、模擬器、以及其他軟件包等。)
二、安裝yum-plugin-fastestmirror(自動挑選快的鏡像站)
su -c 'yum install yum-fastestmirror' (注:確定/etc/yum.conf中的plugins=1,搞定!)
三、安裝yumex(yum的圖形前端)
su -c ' yum install yumex'
四、然后對系統(tǒng)進(jìn)行整體的升級
su -c ' yum update'
五、顯卡的驅(qū)動
1、安裝nVida顯卡驅(qū)動
su –c ‘yum install kmod-nvidia’ (注:我是使用的這個,我的顯卡是8400gs移動版的!)
GeForce 6, 7, 8, 9 & 200 系列顯卡
su -c 'yum install kmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs'
GeForce FX 顯卡
su -c 'yum install kmod-nvidia-173xx xorg-x11-drv-nvidia-173xx xorg-x11-drv-
nvidia-173xx-libs'
GeForce 4 顯卡
su -c 'yum install kmod-nvidia-96xx xorg-x11-drv-nvidia-96xx xorg-x11-drv-nvidia-96xx-
libs'
(注:重啟之后你就可以在屏幕上看到 nvidia 的標(biāo)志了)
2、安裝 ATi顯卡的驅(qū)動(我不 ATi用戶,所以沒有寫!)
六、適用設(shè)置
1、在相同窗口中打開文件夾
依次打開系統(tǒng)-->首選項-->個人-->文件管理,在行為Tab頁中選中“總是在瀏覽器窗口中打開”這個選項。
2、訪問 Windows 分區(qū)
Fedora 10 ntfs-3g 被默認(rèn)安裝,你可以對 NTFS 直接有讀/寫權(quán)限。
如果你想用鼠標(biāo)點兩下就可以啟用/禁用外部 和/或 內(nèi)部的設(shè)備寫入支持嗎,你可以安裝 ntfs-config配置工具。
su -c 'yum install ntfs-config'
之后你會在 系統(tǒng)-->管理-->NTFS 配置工具中找到它。
3、安裝OpenJRE或OpenJDK
安裝OpenJRE使用下面命令:
su -c 'yum install java-1.6.0-openjdk'
如果你是一位JAVA開發(fā)者安裝OpenJDK請使用下面命令:
su -c 'yum install java-1.6.0-openjdk-devel'
當(dāng)然如果你想安裝所有的OpenJDK 6 packages,請使用下面的命令:
su -c 'yum install java-1.6.0-openjdk*'
七、應(yīng)用程序
1、安裝rar壓縮支持unrar
su -c 'yum install unrar'
2、安裝chm 閱讀器
su -c 'yum install gnochm'
3、配置Firefox安裝Flash 插件
(注:在兩個之間選擇一個就OK,如果你是x86-64位的系統(tǒng),我建議你安裝x86-64位的Flash插件)
(1)安裝32位版Flash插件
首先你必須安裝了 Adobe 軟件倉庫
su
rpm -ivh http://linuxdownload.adobe.com/linux/i386/adobe-release-i386-1.0-1.noarch.rpm
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
接下來打開終端并輸入:
su -c 'yum install flash-plugin'
完成之后,重啟 Firefox 并打開工具-->附加組件-->>插件,你應(yīng)該可以看到插件列表中的 Shockwave
Flash 插件了。
(2)安裝x86-64位的Flash插件
x86-64位的Flash插件(64位的現(xiàn)在還是測試版,但是使用還是相當(dāng)不錯,我在使用,只有土豆不能訪問)
Adobe公司終于發(fā)布了64位版的Flash Player。盡管這還是一個Alpha版,但是已經(jīng)很穩(wěn)定了,要嘗試請下載Flash Player插件64位版,解壓并且粘貼庫文件到Firefox的插件目錄就可以了。(/home/OrientSun/.mozilla /plugins)OrientSun為當(dāng)前用戶目標(biāo),你只要把他改成你自己的用戶名就OK。
下載地址:http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.d20.7.linux-x86_64.so.tar.gz
tar -zxf libflashplayer-10.0.d20.7.linux-x86_64.so.tar.gz
su -c 'mv ~/.mozilla/plugins'
如果你之前使用nspluginwrapper和32位版的Flash Player你首先需要刪除他們
su -c 'yum remove flash-plugin nspluginwrapper.{i386,x86_64} pulseaudio-libs.i386'
4、安裝Skype
最好通過Skype的軟件倉庫來安裝Skype,因為這樣最簡單方便,打開終端輸入:
su -c 'gedit /etc/yum.repos.d/skype.repo'
在這個文件中復(fù)制下面幾行:
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
enabled=1
gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc
gpgcheck=0
之后你就可以自由的安裝或者升級 Skype 了。
su -c 'yum install skype'
su -c 'yum update skype'
5、Google Earth(谷歌地球)
請訪問這個頁面http://earth.google.com/download-earth.html 下載 GoogleEarthLinux.bin 文件,之后打開終端進(jìn)入你保存該文件的目錄,默認(rèn)的下載目錄是 ~/下載 。執(zhí)行命令安裝它:
su -c 'sh GoogleEarthLinux.bin'
然后你就可以在 應(yīng)用程序-->英特網(wǎng)-->Google Earth 找到它,請注意,要讓它更好的運(yùn)行,你必須安裝顯卡驅(qū)動。
6、安裝BT下載軟件Azureus(毒蛙)
su -c 'yum install azureus'
八、配置多媒體
1、音頻播放:
(1)、安裝audacious
su -c 'yum install audacious audacious-plugins audacious-plugins-freeworld audacious-plugins-freeworld-*'
如果你想要當(dāng)雙擊 mp3 文件的時候添加到播放隊列,通過下面操作實現(xiàn):
su -c 'gedit /usr/share/applications/fedora-audacious.desktop'
修改 Exec=audacious 為 Exec=audacious -e
(2)、安裝Rhythmbox
su -c 'yum install gstreamer rhythmbox'
添加 mp3和其他音頻支持輸入:
su -c 'yum install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly'
2、DVD和視頻播放:
(1)、DVD 播放
為了能播放dvd你應(yīng)該現(xiàn)安裝適當(dāng)?shù)慕獯a器:
su -c 'yum install libdvdread libdvdnav lsdvd'
(2)、視頻文件播放
su -c 'yum install ffmpeg ffmpeg-libs gstreamer-ffmpeg libmatrosca xvidcore'
(3)、Fedora10已經(jīng)裝了totem了,如果你想用它來放dvd的話,輸入:
su -c 'yum install totem-xine totem-gstreamer xine-lib-extras-freeworld'
(4)、Mplayer/SMPlayer
我比較喜歡這個播放器.它支持了幾乎所有的視頻格式,還有字幕,如果你已經(jīng)安裝了前面說的那些解碼器了的話:
su -c 'yum install mplayer smplayer'
(5)、VLC
VLC支持了幾乎所以的視頻格式而不需要安裝額外的解碼器:
su -c 'yum install vlc'
(6)、kaffeine
Kaffeine是另外的一個是用xine引擎的kde媒體播放器:
su -c 'yum install kaffeine xine xine-lib xine-lib-extras-freeworld'
(注:X86_64位要解決rm播放格式,請到http://www.mplayerhq.hu/MPlayer/releases/codecs /essential-amd64-20071007.tar.bz2下載,解壓后COPY到/usr/lib64/codecs;這樣以后就可以使用 smplayer或是totem來播放rm)
(7)、Avidemux(多媒體編輯器)
Avidemux是一個非常好的多媒體編輯器.安裝輸入:
su -c 'yum install avidemux'
(注:它可以在"應(yīng)用程序->聲音和視頻->Avidemux 視頻編輯器"找到.)
九、wine安裝
su -c 'yum install wine'(這樣安裝成功的版本不是最新的wine-1.1.9,要想是最新版請使用下面的命令升級。)
su -c 'yum --enablerepo=updates-testing upgrade wine'
su -c 'rm -fr ~/.wine'(刪除舊的配置文件)
十、桌面特效(讓你的Fedora10更漂亮)
Compiz 需要直接渲染技術(shù)正常工作才行,檢查你是否安裝了直接渲染,輸入命令:
glxinfo | grep direct
如果你看到 direct rendering: Yes 的信息,表明你可以繼續(xù)安裝 Compiz 包。
通過一個星期的測試,我還是建議大家安裝官方包。(大家在官方安裝包和非官方安裝包中選擇一個安裝)
1、*官方安裝包
su -c 'yum remove compiz'
rm -rf ~/.gconf/apps/compiz
su -c 'yum install compiz-fusion compiz-fusion-gnome compiz-fusion-extras compiz-fusion-extras-gnome compizconfig-backend-gconf compiz-manager gnome-compiz-manager ccsm fusion-icon fusion-icon-gtk emerald emerald-themes'
2、*非官方包
(1). Install the compiz-fusion-release rpm ( you need wget installed i.e yum install wget )
(安裝前請先安裝第三方的源,使用下面的命令:)
su
wget http://www.linux-ati-drivers.homecall.co.uk/compiz-fusion-release-1-6.noarch.rpm
rpm -Uvh compiz-fusion-release-1-6.noarch.rpm
rm -f compiz-fusion-release-1-6.noarch.rpm
(2). Install compiz-fusion ( you will need to remove the fedora compiz packages first and
delete the old compiz configuration files /home/username/.gconf/apps/compiz )
(注:刪除compiz和compiz配置文件命令如下:)
su -c 'yum remove compiz'
rm -rf ~/.gconf/apps/compiz
使用下面的命令開始安裝吧!
su
yum install compiz-gnome fusion-icon-gtk compiz-fusion-plugins-unsupported compiz-fusion-plugins-extra compiz-bcop ccsm emerald-themes compizconfig-backend-gconf
3、添加自動起動:
進(jìn)入系統(tǒng)-->首選項-->個人-->會話,單擊添加,輸入:
名稱: Fusion Icon
命令: fusion-icon
注釋: Compiz-Fusion桌面特效應(yīng)用程序