centos5.3 yum 安裝mplayer

首先yum install yum-priorities,yum-priorities插件可以爲yum的源倉庫指定優先級.

如果安裝包是用高優先級的源倉庫安裝的,那麼這些包就不能用低優先級別的源倉庫去更新。同樣的,如果一個包可以從多個源倉庫中下載安裝,但指定了優先級別 之後,這個包就會從最高優先級的源倉庫安裝。假如用戶使用一個或者多個第三方源倉庫,這些源倉庫都會更新系統文件,有些更新甚至會潛在的危害你的的 CentOS系統,這個時候,該插件就特別起作用了。
現在開始編輯 /etc/yum/pluginconf.d/priorities.conf文件,必須先確認其中有以下的設置:[main]
enabled=1  
然後編輯 /etc/yum.repos.d/,如下:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever – Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#released updates
[updates]
name=CentOS-$releasever – Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=2
也就是每個倉庫後面添加了個priority=x,通過上面的設定之後,Yum將不會從低優先級的源更新那些來自base和update倉庫的的安裝包。
這 裏x必須取1到99之間的整數。倉庫的默認優先級是99.序號最小的源倉庫具有最高的優先級。同常,最好是爲CentOS base 和 update倉庫選擇非常高的優先級(畢竟是官方的嘛!),在上面的CentOS-Base.repo 文件裏,CentOS base 和 update倉庫都被指定了最高的優先級(priority=1)。
下面開始安裝mplayer:
安裝RPMforge:
先下載rpmforge-release包,根據你的系統,從下面的鏈接中選擇一個下載。
i386http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64 http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
安裝DAG’s GPG key
#rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
檢查你下載的包
#rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm
安裝rpmforge包
#rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm
運行了上述的命令後,將會向yum源倉庫里加入一個配置文件,並且會導入合適的 GPG keys。此時,最好也設置RPMForge倉庫的優先級。
用下面的命令檢查更新
#yum check-update
最後就安裝mplayer了
#yum install mplayer*
然後到這裏下載兩個編碼包all-20071007.tar.bz2和windows-all-20071007.zip
http://www1.mplayerhq.hu/MPlayer/releases/codecs/
yum安裝mplayer後編碼包默認應安裝在/usr/lib/codecs/中,
# tar jxvf all-20071007.tar.bz2
# mv -f all-20071007/* /usr/lib/codecs/
# unzip windows-all-20071007.zip
# mkdir /usr/lib/win32
# mv window-all-20071007/* /usr/lib/win32
# ln -s /usr/lib/codecs /usr/lib/win32
再看看應用程序的影音中是不是出現了mplayer?啓動mplayer就可以播放了,rmvb也一樣搞定

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章