从 Yum 更新中排除特定/某些包的三种方法

2022-11-03,,,,

方法 1:手动或临时用 yum 命令排除

要排除单个包:

# yum update --exclude=kernel
或者
# yum update -x 'kernel'

要排除多个包。以下命令将更新除 kernel 和 php 之外的所有软件包。

# yum update --exclude=kernel* --exclude=php*
或者
# yum update --exclude httpd,php

方法 2:在 yum 命令中永久排除软件包

这是永久性方法

# vi /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=3
exclude=kernel* php*

从 Yum 更新中排除特定/某些包的三种方法的相关教程结束。

《从 Yum 更新中排除特定/某些包的三种方法.doc》

下载本文的Word格式文档,以方便收藏与打印。