yum使用

更新:yum update
安裝:yum install xxx
移除:yum remove xxx
清除已經安裝過的檔案(/var/cache/yum/):yum clean all
搜尋:yum search xxx
列出所有檔案:yum list
查詢檔案訊息:yum info xxx

yum grouplist
yum groupinstall "Web Server"

yum check-update;yum -y update;yum clean all

另外,我們在安裝一些要用到的一些工具時,或許它並不存在於 CentOS yum 的官方資料庫中。所以我們還要另外定義非官方資料庫文件,讓一些實用的工具也能透過 yum 來安裝。

    # vi /etc/yum.repos.d/dag.repo

    [dag]
    name=Dag RPM Repository for Red Hat Enterprise Linux
    baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
    gpgcheck=1
    enabled=1
    http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
    匯入非官方資料庫的GPG
    # rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt


一、強化yum功能

yum install yum-fastestmirror(加快yum下載速度)
yum install yum-priorities

vi /etc/yum/pluginconf.d/priorities.conf
在 [main]下新增enabled=1 (預設已寫上)
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim /etc/yum.repos.d/CentOS-Base.repo
在[base], [addons], [updates], [extras]項目下新增 priority=1
在[centosplus],[contrib]項目下新增 priority=2
/etc/init.d/yum-updatesd restart
二、下載相關套件並安裝(請自行對應)

i386 wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64 wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
安裝金鑰
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt (備份檔案)
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm (以i386為例)
三、檢查更新

yum check-update






[本日志由 tseng 于 2009-05-25 07:14 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
评论: 0 | 引用: 0 | 查看次数: 4575
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭