解決講解CentOS系統(tǒng) yum 安裝mplayer
有次在使用CentOS系統(tǒng)的時候,我下了源碼編譯卻加--enable-gui就出錯,不加就過了,過了卻沒界面,只能聽到聲音,沒辦法,找?guī)讉€rpm文件安裝,明明已經安裝了的文件卻說需要它,最后,我終于尋找到了yum安裝mplayer的方法。
首先yum install yum-priorities,yum-priorities插件可以為yum的源倉庫指定優(yōu)先級。如果安裝包是用高優(yōu)先級的源倉庫安裝的,那么這些包就不能用低優(yōu)先級別的源倉庫去更新。同樣的,如果一個包可以從多個源倉庫中下載安裝,但指定了優(yōu)先級別之后,這個包就會從最高優(yōu)先級的源倉庫安裝。假如用戶使用一個或者多個第三方源倉庫,這些源倉庫都會更新系統(tǒng)文件,有些更新甚至會潛在的危害你的的CentOS系統(tǒng),這個時候,該插件就特別起作用了。
現(xiàn)在開始編輯 /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將不會從低優(yōu)先級的源更新那些來自base和update倉庫的的安裝包。這里x必須取1到99之間的整數(shù)。CentOS系統(tǒng)倉庫的默認優(yōu)先級是99.序號最小的源倉庫具有最高的優(yōu)先級。同常,最好是為CentOS系統(tǒng) base 和 update倉庫選擇非常高的優(yōu)先級(畢竟是官方的嘛!),在上面的CentOS-Base.repo 文件里,CentOS base 和 update倉庫都被指定了最高的優(yōu)先級 (priority=1)。
下面CentOS系統(tǒng)開始安裝mplayer:
安裝RPMforge:
先下載rpmforge-release包,根據你的系統(tǒng),從下面的鏈接中選擇一個下載。
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
運行了上述的命令后,將會向CentOS系統(tǒng)yum源倉庫里加入一個配置文件,并且會導入合適的 GPG keys。此時,最好也設置RPMForge倉庫的優(yōu)先級。
用下面的命令檢查更新
#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
再看看CentOS系統(tǒng)中應用程序的影音中已經出現(xiàn)了mplayer。啟動mplayer就可以播放了,rmvb也一樣被搞定。
【編輯推薦】