管理Linux软件——yum

yum介绍

yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。基於RPM包管理,能够从指定的服务器(即 yum仓库)自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。

yum源全局设置

[root@51cto Packages]# cat /etc/yum.conf 
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=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=16&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

这里面一般不需要我们更该

cachedir=/var/cache/yum/$basearch/$releasever  缓存目录,下载软件时rpm包暂时放在哪

keepcache=0  装完之后,安装包是否保留,0不保留。

debuglevel=2       调试级别

logfile=/var/log/yum.log    记录到日志

exactarch=1    检查平台是否兼容,1检查

obsoletes=1    检查包是否废弃

gpgcheck=1    检查来源是否合法 需要有软件制作发行者的公钥信息

plugins=1      检查是否启用插件

installonly_limit=3

配置多个yum源

网络

  ftp

  http

  优点:下载的安装包可能比本地yum源的新

  缺点:下载速度慢

本地yum源

  就是Linux上一个文件夹,可以把Linux安装盘作为yum源,把Linux安装盘上的文件考到文件夹。

  优点:下载速度快

  缺点:下载的安装包可能没有网络yum源的新

使用Linux安装盘做本地yum源

检查安装包是否在光驱

为确保万无一失,把光驱重新挂载一下

 

 

猜你喜欢

转载自www.cnblogs.com/kelamoyujuzhen/p/9142103.html