• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : Exclusion with Yum For Kernel Updates

by admin

Question : How to make an exclusion list so that anyone running the command “yum update” will not download any kernel patches ?

Answer :
This can be done using 2 ways :
1. yum configuration file yum.conf (permanent)
2. Using command line options

Using yum.conf

1. From the man page of yum.conf :

# man yum.conf
exclude
List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg.* and ?) are allowed.

2. This would need to be under the “[main]” section in yum.conf, on the client.

# 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 Updates
exclude=kernel*

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

3. Verify that you don’t see a kernel package in the installable packages when you run yum update command :

# yum update

From command line

This is temporary and we need to give the exclusion list on command line.

# yum --exclude=kernel* update

Filed Under: Linux

Some more articles you might also be interested in …

  1. mkfs.exfat: command not found
  2. godot Command Examples
  3. do-release-upgrade Command Examples in Linux
  4. mons: command not found
  5. doctl apps: Used to manage digitalocean apps
  6. iftop Command Examples in Linux
  7. mpstat: command not found
  8. jdupes Command Examples
  9. CentOS / RHEL : How to migrate storage (LVM) with pvmove Command
  10. rtcwake Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright