YUM & APT 套件管理調校

来源:百度文库 编辑:神马文学网 时间:2024/05/01 23:39:16
YUM & APT 套件管理調校
YUM, 全名 Yellowdog Updater Modified
APT, 全名 Advanced Package Tool
以下是在 Fedora Linux 的操作備忘:
YUM 調校 加入 APT 套件管理功能 YUM / APT 常用參數對照
匯入 rpm 簽名檔
rpm --import /usr/share/doc/fedora-release-n/RPM-GPG-KEY*
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/
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/
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 -ivhhttp://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
[ ]: 表示該參數可有可無
參考資料:
新竹縣網 APT 伺服器 - APT 的安裝、使用 by 楊錦昌Happy Tux 自由軟體隨筆 - fedora core 5 yum 調校
Posted by Jamyy at 2006年04月11日 07:28
from: http://cha.homeip.net/blog/archives/2006/04/yum_apt.html#more