Yum Update Exclude Some Packages in CentOS / RHEL
Below I will show some examples how to exclude specific packages updates, and how to permanently exclude packages update from automatic Yum Update. More information you can found in yum update manuals.
Yum is the primary tool for getting, installing, deleting, querying, and managing Red Hat Enterprise Linux RPM software packages. Yum command cheat sheet.
How To Exclude Specific Packages from Yum Update in CentOS / RHEL
To exclude manualy package from yum update use command:
# yum update --exclude=PACKAGENAME
PACKAGENAME replace with your specific package name.
For example i don’t want update Linux Kernel and all Kernel related packages:
# yum update --exclude=kernel*
Permanently Disable Some Packages Updates From Automatic Yum Update
To Permanently Exclude Package Update (postfix) from Yum Update edit yum configuration file /etc/yum.conf with any editor and add: exclude=postfix line in end of file. In case if you need exclude multiple packages separate them using a single space or comma.
In next example we will permanently prevent Linux Kernel and postfix packages updating during automatic yum update command execution.
[main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 exclude=kernel* redhat-release* postfix