How To Exclude Packages from Apt-Get Upgrade
Edit /etc/yum.conf in an editor and add exclude line as shown in below example configuration file. The below will prevent updating packages name begin with the kernel, RedHat-release, PHP, MySQL, and Httpd.
1. Exclude Packages with Command
You can simply use –exclude command line parameter with yum to exclude specific packages from getting update. You can specify multiple packages as per your requirement. For example, below command will update all packages except kernel and PHP.2. Exclude Packages from Auto Update
In addition, You can also add entries in /etc/yum.conf to disable package updates permanently. Using this option, you don’t need to specify each time you run yum update command from prompt. This will also prevent packages from any accidental updates.Edit /etc/yum.conf in an editor and add exclude line as shown in below example configuration file. The below will prevent updating packages name begin with the kernel, RedHat-release, PHP, MySQL, and Httpd.