解决讲解CentOS系统 yum 安装mplayer

系统 Linux
在使用CentOS系统的时候,下了源码编译却加--enable-gui会出现错误,这里,我们就来讲解CentOS系统 yum 安装mplayer的问题。

有次在使用CentOS系统的时候,我下了源码编译却加--enable-gui就出错,不加就过了,过了却没界面,只能听到声音,没办法,找几个rpm文件安装,明明已经安装了的文件却说需要它,最后,我终于寻找到了yum安装mplayer的方法。

首先yum install yum-priorities,yum-priorities插件可以为yum的源仓库指定优先级。如果安装包是用高优先级的源仓库安装的,那么这些包就不能用低优先级别的源仓库去更新。同样的,如果一个包可以从多个源仓库中下载安装,但指定了优先级别之后,这个包就会从最高优先级的源仓库安装。假如用户使用一个或者多个第三方源仓库,这些源仓库都会更新系统文件,有些更新甚至会潜在的危害你的的CentOS系统,这个时候,该插件就特别起作用了。

现在开始编辑 /etc/yum/pluginconf.d/priorities.conf文件,必须先确认其中有以下的设置:[main] enabled=1 
然后编辑 /etc/yum.repos.d/,
如下:

  1. CentOS-Base.repo  
  2. This file uses a new mirrorlist system developed by Lance Davis for CentOS.  
  3. The mirror system uses the connecting IP address of the client and the  
  4. update status of each mirror to pick mirrors that are updated to and  
  5. geographically close to the client. You should use this for CentOS updates  
  6. unless you are manually picking other mirrors.  
  7. If the mirrorlistdoes not work for you, as a fall back you can try the   
  8. remarked out baseurlline instead.  
  1. [base]  
  2. name=CentOS-$releasever - Base  
  3. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os 
  4. #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/  
  5. gpgcheck=1 
  6. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  7. priority=1 
  8. #released updates   
  9. [updates]  
  10. name=CentOS-$releasever - Updates  
  11. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates 
  12. #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/  
  13. gpgcheck=1 
  14. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  15. priority=1 
  16. #packages used/produced in the build but not released  
  17. [addons]  
  18. name=CentOS-$releasever - Addons  
  19. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&,汽车尾气达标;arch=$basearch&repo=addons 
  20. #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/  
  21. gpgcheck=1 
  22. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  23. priority=1 
  24. #additional packages that may be useful  
  25. [extras]  
  26. name=CentOS-$releasever - Extras  
  27. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras 
  28. #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/  
  29. gpgcheck=1 
  30. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  31. priority=1 
  32. #additional packages that extend functionality of existing packages  
  33. [centosplus]  
  34. name=CentOS-$releasever - Plus  
  35. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus 
  36. #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/  
  37. gpgcheck=1 
  38. enabled=0 
  39. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  40. priority=2 

也就是每个仓库后面添加了个priority=x,通过上面的设定之后,Yum将不会从低优先级的源更新那些来自base和update仓库的的安装包。这里x必须取1到99之间的整数。CentOS系统仓库的默认优先级是99.序号最小的源仓库具有最高的优先级。同常,最好是为CentOS系统 base 和 update仓库选择非常高的优先级(毕竟是官方的嘛!),在上面的CentOS-Base.repo 文件里,CentOS base 和 update仓库都被指定了最高的优先级  (priority=1)。

下面CentOS系统开始安装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

运行了上述的命令后,将会向CentOS系统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/中

  1. tar jxvf all-20071007.tar.bz2  
  2. mv -f all-20071007/* /usr/lib/codecs/   
  3. unzip windows-all-20071007.zip  
  4. mkdir /usr/lib/win32  
  5. mv window-all-20071007/* /usr/lib/win32  
  6. ln -s /usr/lib/codecs /usr/lib/win32  

再看看CentOS系统中应用程序的影音中已经出现了mplayer。启动mplayer就可以播放了,rmvb也一样被搞定。

【编辑推荐】

  1. CentOS系统 aMule 编译
  2. CentOS系统下FTP server安装
  3. 如何在CentOS系统下安装网卡驱动
  4. 保卫你的CentOS系统安全
  5. CentOS系统快速安装LNMP
责任编辑:小霞
相关推荐

2010-02-22 18:04:27

CentOS mpla

2010-04-01 15:05:05

CentOS系统

2010-01-15 13:55:17

CentOS mail

2010-04-06 13:23:56

CentOS系统

2010-04-01 13:48:58

CentOS系统

2010-06-09 11:05:48

Opensuse安装m

2010-01-13 16:55:10

CentOS PHP安

2021-08-04 06:30:27

CentOS 8OpenVASGVM

2009-11-23 17:33:07

SuSE Linux下

2009-07-07 09:11:23

LINUXmplayer

2010-03-30 09:06:26

CentOS安装

2010-01-13 15:53:11

CentOS vsft

2010-01-14 16:53:40

CentOS Apac

2010-03-29 15:18:52

CentOS系统

2010-06-09 11:17:34

openSUSE Mp

2010-01-13 14:53:46

centos配置

2024-02-27 13:24:34

Centos系统:yum

2010-03-30 17:28:10

CentOS操作系统

2011-03-11 12:57:28

CentOS5.5YUMLAMP

2009-02-17 23:41:43

Mplayer播放器常见问题
点赞
收藏

51CTO技术栈公众号