Linux Is Not Matrix——repo浅解

来源:互联网 发布:vb与vs的区别 编辑:程序博客网 时间:2024/05/21 12:42

  在安装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=yumdistroverpkg=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 - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=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)然后去对应的地址下载对应的软件,就这么简单。



0 0
原创粉丝点击