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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. rankmirrors Command Examples in Linux
  2. What is the purpose of “system user” in MySQL Replication
  3. Nohup Command Examples – Runs a Command that Keeps Running after You Log Out
  4. 5 Useful Command Examples to Monitor User Activity under Linux
  5. a2enmod Command Examples in Linux
  6. CentOS / RHEL 6 : How to disable IPv6
  7. pngcheck Command Examples in Linux
  8. lvscan Command Examples in Linux
  9. “-bash: firewall: command not found” – How to resolve in CentOS/RHEL 7
  10. How to extract RAR files in CentOS/RHEL 7 and 8

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright