Linux Is Not Matrix——repo浅解

  在安装jenkins的时候曾经说过要研究一下yum的配置文件,说白了就是他的软件仓库。

  CentOS下,yum的配置文件可以分为两部分,去哪个地址下载软件,还有yum本身的一些配置。

  我们先看看yum本身的配置文件配置了什么。

[main]
cachedir=/var/cache/yum/$basearch/$releasever
	//软件缓存目录,就是下载的rpm文件存储的路径
keepcache=0
	//是否保存下载的软件包,0代表不保留,1为保留
debuglevel=2
	//Debug信息输出等级,不太懂,略过- -
logfile=/var/log/yum.log
	//日志存放位置
exactarch=1
	//这个设置为1之后你的linux是多少位,yum就会安装多少位的软件,
obsoletes=1
	//这个是允许更新旧的包
gpgcheck=1
	//检查rpm包的来源是否有效且安全
plugins=1
	//是否启用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


#  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
# in /etc/yum.repos.d

  大概就是这些东西,配置的全是一些yum运行时需要的参数,再来看看配置了下载地址的repo源文件。

[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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

  $releasever:代表发行版的版本,从[main]部分的distroverpkg获取,如果没有,则根据centos-release包进行判断。

  $arch:cpu体系,如i686,athlon等

  $basearch:cpu的基本体系组,如i686和athlon同属i386,alpha和alphaev6同属alpha

  这是一个基本软件的URL配置,其他的配置都是一样的,只是下载的东西不同,其实就是个URLyum会检测安装的centos版本,系统处理器类型(32 ro64)然后去对应的地址下载对应的软件,就这么简单。



评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值