CentOS安装播放软件mplayer和下载软件prozilla,配置yum源
其他还有RPMForge源和RPMFusion源(暂时没有centos7的源),更多软件包在pkgs.org,比较好的国内源有163和UTSC。一般情况下不用配置其他的外部源,系统自带的源就比较好用了。
yum的配置文件分为main和repository,main部分定义了全局配置选项,位于/etc/yum.conf中。repository部分定义了每个源/服务器的具体配置,可以有一到多个,位于/etc/yum.repo.d目录下的各*.repo文件中。
yum的配置文件
[main]
cachedir=/var/cache/yum/$basearch/$releasever
#cachedir:yum更新软件时的缓存目录,默认设置为/var/cache/yum
keepcache=0
#是否保留缓存,0不保留
debuglevel=2#debuglevel:Debug信息输出等级,范围为0-10,缺省为2
logfile=/var/log/yum.log
#logfile:存放系统更新软件的日志的目录。用户可以到/var/log/yum.log文件去查询自己在过去的日子里都做了哪些更新。
exactarch=1
#设置为1,则yum只会安装和系统架构匹配的软件包,例如,yum不会将i686的软件包安装在适合i386的系统中。默认为1
obsoletes=1
#这是一个update的参数,具体请参阅yum(8),简单的说就是相当于upgrade,允许更新陈旧的RPM包。此选项在进行发行版跨版本升级的时候会用到。
gpgcheck=1
#有1和0两个选择,分别代表是否是否进行gpg校验。这个选项如果设置在[main]部分,则对每个repository都有效。默认值为0.
plugins=0
#是否允许使用插件,默认是0不允许,比如yum-fastestmirror这个插件。
installonly_limit=5
#允许保留多少个内核包。
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
#错误报告
distroverpkg=centos-release
#指定一个软件包,yum会根据这个包判断你的发行版本,默认是centos-release,也可以是安装的任何针对自己发行版的rpm包。用于获得yum配置文件中$releasever的值。
exclude=selinux* kernel*
#屏蔽不想更新的RPM包,可用通配符,多个RPM包之间使用空格分离。
#pkgpolicy=newest#包的策略。一共有两个选项,newest和last,这个作用是如果你设置了多个repository,而同一软件在不同的repository中同 时存 在,yum应该安装哪一个,如果是newest,则yum会安装最新的那个版本。如果是last,则yum会将服务器id以字母表排序,并选择最后的那个 服务器上的软件安装。一般都是选newest。
#tolerant=1
#如果值为1,则yum会忽略任何的有关包的错误。举例来说,当执行yum来安装baz时,如果baz包已经安装在系统中了,则yum会继续重复安装baz,而不会报错。默认值为1。
#retries=20
#网络连接发生错误后的重试次数,如果设为0,则会无限重试。默认值为6
This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# CentOS-Base.repo
#
# 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&infra=$infra
选择自己访问速度较快的镜像服务器地址复制并粘贴到repo文件中,我们就能获得较快的更新速度了,格式如baseurl= ftp://www.utsc.edu.cn/centos/7/x86_64/os http://www.utsc.edu.cn/centos/7/x86_64/os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#exclude=selinux* kernel*
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
mkdir /usr/lib/wincodecs
tar -xvf all-20110131.tar.bz2
mv all-20110131/* /usr/lib/codecs
unzip windows-all-20071007.zip
mv windows-all-20071007/* /usr/lib/wincodecs
cd MPlayer-1.2
./configure--prefix=/usr/local/mplayer--enable-gui --enable-freetype --codecsdir=/usr/lib/codecs --win32libdir=/usr/lib/wincodecs --language=zh_CN && make && make install
--prefix=/usr/local/mplayer 是安装路径(可以不用指定。默认就行。)
--enable-gui 安装图形化用户界面
--enable-freetype 调节字体(可以不用,默认不写没有问题)
--codecsdir=/usr/lib/codecs/
--win32libdir=/usr/lib/wincodecs 指定解码位置
--language=zh_CN 中文