「YUM」- 杂记 @20210425

常用的YUM命令

#!/bin/sh

# 更新缓存,更新本地的YUM缓存:
yum clean all

# 搜索命令,当命令未找到时,查看它所属的软件包:
yum provides $(which yum)

# 检查系统是否存在需要更新的软件:
yum check-update

# 列出所有的可用的安全更新:
yum updateinfo list security all

# 安装指定版本的包:
yum install "<package name>-<version info>"

# 软件包降级
yum downgrade "<package name>-<version info>"

显示软件包所属仓库

How to know from which yum repository a package has been installed?

#!/bin/sh

yum install -y yum-utils
repoquery -i "your-package-name"

查看包中文件

# https://www.cyberciti.biz/faq/rhel-centos-fedora-list-contents-of-package-using-yum-command/
yum install -y yum-utils
repoquery --list "bash"
repoquery -q -l "yum-utils"

# https://www.tecmint.com/list-files-installed-from-rpm-deb-package-in-linux/
rpm -qlp "<pkg name>.rpm"

相关文章

「YUM」- 限制YUM更新软件包
「Kubernetes」- Setup Yum Mirror
「RPM, YUM and DNF」- 常见错误
「YUM」- 使用代理服务(“提高下载速度”)
「CentOS」- 使用源码包开始安装
「YUM」- 配置YUM源

参考文献

Is it possible to limit yum so that it lists or installs only security updates?
How can I instruct yum to install a specific version of package X?
How to use yum to downgrade or rollback some package updates?


posted @ 2021-04-25 18:20  研究林纳斯写的  阅读(44)  评论(0编辑  收藏  举报