CentOS软件管理工具yum使用

CentOS软件管理工具yum使用

1.简介

Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。

2.通过包名搜索

yum search tcpdump

3.搜索具备指定可执行命令的包

yum provides tree
# 或
yum provides "*/tree"

# 搜索结果如下:
psmisc-22.20-16.el7.x86_64 : Utilities for managing processes on your system
源    :base
匹配来源:
文件名    :/usr/bin/pstree

yum install -y psmisc-22.20-16.el7.x86_64


# 查询包含指定so库
yum provides nouveau_dri.so

4.查看包依赖关系

yum deplist net-tools

5.下载指定包及其依赖包并进行离线安装

yum install yum-utils
yumdownloader --resolve --destdir /tmp/net-tools net-tools

cd /tmp/net-tools
rpm -ivh ./*

更多命令使用man命令查看手册
man yum

6./etc/yum.conf

通过man yum.conf查看手册

yum配置文件

[main]
# 缓存路径
cachedir=/var/cache/yum/$basearch/$releasever
# 0-不保留 1-保留,可通过yum clean all (相当于yum clean headers+yum clean packages);可结合packages时间使用
keepcache=0
# 0-10
debuglevel=2
logfile=/var/log/yum.log
#CPU架构精准匹配 0-否 1-是
exactarch=1
# 提供过期安装包
obsoletes=1
# gpg 签名验证
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

参考:
centos下查看软件依赖关系

Linux - yum - 配置简介

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

搬山境KL攻城狮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值