标签:main fedora orm ali center 额外 就是 基础 def
yum工作原理
yum是一个RPM包的前端管理工具,在rpm包的依赖关系已经被建成数据库的前提下它能够实现自动查找相互依赖的人rpm包,并从repository中下载互相依赖的rpm包到本地。
YUM的工作原理并不复杂,每一个 RPM软件的头(header)里面都会纪录该软件的依赖关系,那么如果可以将该头的内容纪录下来并且进行分析,可以知道每个软件在安装之前需要额外安装 哪些基础软件。也就是说,在服务器上面先以分析工具将所有的RPM档案进行分析,然后将该分析纪录下来,只要在进行安装或升级时先查询该纪录的文件,就可以知道所有相关联的软件。所以YUM的基本工作流程如下:
yum的一切信息都存储在一个叫yum.reops.d目录下的配置文件中,通常位于/etc/yum.reops.d目录下:
cat /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever #yum下载的rpm包的缓存目录
keepcache=0 #缓存是否保存,1保存,0不保存
debuglevel=2
logfile=/var/log/yum.log #日志文件
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
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
标签:main fedora orm ali center 额外 就是 基础 def
原文地址:https://www.cnblogs.com/LMIx/p/10732486.html