We may not want to update some packages such the kernel on a stable server while updating the system. If we run "dnf update" or "yum update", we may get suggested by dnf/yum to install all the packages with updates.
Method making dnf/yum not update certain packages
The method is simple. Add this line to dnf or yum’s configuration file:
For example, to exclude package kernel, nss and nss- from being updated, the line will be:
exclude=kernel* nss nss-*
The configuration file for dnf/yum
For dnf, the configuration file is located under:
For yum, the configuration file is located under: