« 2006/04, Vol. 123 PChome Magazine | 首頁 | GRUB & LILO 操作備忘 »

2006年04月11日

YUM & APT 套件管理調校

YUM, 全名 Yellowdog Updater Modified
APT, 全名 Advanced Package Tool

以下是在 Fedora Linux 的操作備忘:

匯入 rpm 簽名檔

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

rpm --import /usr/share/doc/fedora-release-n/RPM-GPG-KEY* (Fedora Core 3 (含) 以前的版本)

YUM 調校

Fedora Core 1 & 2 編輯目標: /etc/yum.conf
Fedora Core 3 (含) 以上編輯目標: /etc/yum.repos.d/ 路徑裡的 *.repo 檔案

vi /etc/yum.repos.d/fedora.repo

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=ftp://apt.nc.hcc.edu.tw/pub/fedora/linux/core/$releasever/$basearch/os/
enabled=1
gpgcheck=1

以上適用 Fedora 全系列, i386

其他可使用的 base 來源, 適用 Fedora 全系列, i386 & x86_64

http(or ftp)://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/$releasever/$basearch/os/
ftp://linux.sinica.edu.tw/fedora/linux/core/$releasever/$basearch/os/

--- 2007.09.19 補充: Fedora 7

baseurl=ftp://ftp.isu.edu.tw/Linux/Fedora/linux/releases/$releasever/Everything/$basearch/os/

vi /etc/yum.repos.d/fedora-updates.repo

[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
baseurl=ftp://apt.nc.hcc.edu.tw/pub/fedora/linux/core/updates/$releasever/$basearch/
enabled=1
gpgcheck=1

以上適用 Fedora 全系列, i386

其他可使用的 updates 來源, 適用 Fedora 全系列, i386 & x86_64

http(or ftp)://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/updates/$releasever/$basearch/
ftp://linux.sinica.edu.tw/fedora/linux/core/updates/$releasever/$basearch/

--- 2007.09.19 補充: Fedora 7

baseurl=ftp://apt.ilc.edu.tw/Linux/Fedora/linux/updates/$releasever/$basearch/

vi /etc/yum.repos.d/fedora-extras.repo

[extras]
name=Fedora Core $releasever - $basearch - Extras
baseurl=ftp://apt.nc.hcc.edu.tw/pub/fedora/linux/extras/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras

以上適用 Fedora 3~5, i386

其他可使用的 extras 來源

http(or ftp)://ftp.isu.edu.tw/pub/Linux/Fedora/linux/extras/$releasever/$basearch/
    簽名檔: ftp://ftp.isu.edu.tw/pub/Linux/Fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras
    (適用 Fedora 3~5, i386 & x86_64)
ftp://140.111.66.34/Linux/Fedora/linux/extras/$releasever/$basearch/
   
(適用 4~5, i386)

vi /etc/yum.repos.d/freshrpms.repo

[freshrpms]
name=Fedora Core $releasever - $basearch - Freshrpms
baseurl=ftp://apt.nc.hcc.edu.tw/pub/freshrpms/fedora/linux/$releasever/
enabled=1
gpgcheck=1
gpgkey=ftp://apt.nc.hcc.edu.tw/pub/freshrpms/RPM-GPG-KEY

以上適用 Fedora 全系列

其他可使用的 freshrpms 來源

ftp://140.111.66.34/Linux/Fedora/linux/freshrpms/$releasever/ (適用 Fedora 4、5)
    簽名檔: ftp://140.111.66.34/Linux/Fedora/linux/freshrpms/RPM-GPG-KEY
http(or ftp)://ftp.freshrpms.net/pub/freshrpms/fedora/linux/$releasever/ (適用 Fedora 全系列)
    簽名檔: http://ftp.freshrpms.net/pub/freshrpms/RPM-GPG-KEY

加入 APT 套件管理功能

freshrpms.net 下載並安裝 apt for Fedora Linux 套件, 以下以 FC3 為例:

rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/3/apt/apt-0.5.15cnc6-1.1.fc3.fr.i386.rpm

編輯 /etc/apt/sources.list, 加入以下內容

rpm ftp://apt.nc.hcc.edu.tw/pub/apt/fedora/linux/3 i386 os updates freshrpms firefly extra
rpm ftp://cle.linux.org.tw/apt/heidelberg Fedora os updates freshrpms cle

Fedora Linux 各版本代號一覽

Fedora Core 5 --> bordeaux
Fedora Core 4 --> stentz
Fedora Core 3 --> heidelberg
Fedora Core 2 --> tettnang
Fedora Core 1 --> yarrow

更新遠端伺服器套件檔案清單 (凡變更過 /etc/apt/sources.list 就要執行一次)

apt-get update

常用參數對照

  YUM APT
安裝套件 yum install pkgname apt-get install pkgname
更新套件 yum update [pkgname] apt-get upgrade [pkgname]
移除套件 yum remove pkgname apt-get remove pkgname
列出套件 yum list / info [target]

[target]:

updates
installed
extras

apt-cache pkgnames [pkgname]
apt-cache search regex
apt-cache show pkgname
apt-cache showpkg pkgname
apt-cache depends pkgname
apt-cache stats
apt-cache unmet
清除暫存資料 yum clean target

target:

headers
packages
cache
metadata
all

apt-get clean

[ ]: 表示該參數可有可無

參考資料:

相關網頁:

Posted by Jamyy at 2006年04月11日 07:28

Trackback Pings

TrackBack URL for this entry:
http://cha.homeip.net/cgi-bin/mt/mt-tb.cgi/187

Comments

呵呵..小米,我剛剛看了一下照片..有一張,如果我沒有看錯的話....你要當爸爸了....

小米、恭喜恭喜^^~

Posted by: 馬吉 at 2006年04月11日 12:52

這樣你也看得出來? 佩服、佩服~~
謝謝啦! 預計六月底完工, 屆時再通知大家囉~

Posted by: 小米 at 2006年04月11日 14:03

呵呵,當然的囉。
要好好照顧大嫂呀,女生懷孕是很辛苦的,特別是第一胎。
恭喜^^~~
小朋友出生後要記得放小朋友的照片呀~~

Posted by: 馬吉 at 2006年04月16日 00:13