HOWTO exclude specific packages from being updated via yum or dnf

Here are a few examples on how to exclude some packages from being updated during yum/dnf update:

# yum update --exclude=PACKAGENAME 

Exclude all kernel related packages during update:

# yum update --exclude=kernel*

Exclude gcc and java:

# yum update --exclude=gcc,java

Exclude all gcc and php related packages:

# yum update --exclude=gcc* --exclude=php*

In order to permanently exclude/disable updating of some specific packages you might want to update your dnf.conf or yum.conf eg:

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exclude=kernel* php*             <---

Enable “Subject:” logging in Postfix

Edit the Postfix’s main.cf file and add the following line (or uncomment it):

header_checks = regexp:/etc/postfix/header_checks

Create /etc/postfix/header_checks file and add the following line:

/^subject:/ WARN

Finally, reload/restart Postfix. From now on there will be a “warrning: header subject” in your maillog.