Linux

Exclude Specific Packages From Yum Update In RHEL/CentOS

Exclude Specific Packages From Yum Update In RHEL/CentOS
Written by itsubuntu

Summary: Tutorial To Exclude Specific Packages From Yum Update In RHEL/CentOS

In this RHEL/CentOS tutorial post, we will show you the multiple methods to Exclude Specific Packages From Yum Update In RHEL/CentOS.

Tutorial To Exclude Specific Packages From Yum Update In RHEL/CentOS

We can use  yum Command  to excluse specific package. Yum with  --exclude or -x option can help to get our job done. This is the temporary method to exclude specific package.

Run the following command to excluse specific package. In this example, we are exclusing kernel package from being updated.

yum update --exclude=kernel

or

yum update -x 'kernel'

Run the following command to exclude multiple packages.

yum update --exclude=kernel* --exclude=httpd*

or 

yum update --exclude httpd,kernel

In another meethod, we can exclude packages with yum command permanently

We need to do some tweak in /etc/yum.conf to disable packages updates permanently. Open the yum.conf file and edit it.

sudo 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* httpd*



About the author

itsubuntu

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Dear lovely people, Welcome to itsubuntu.com

Join our mailing list to receive the freebies, tutorials, latest news and updates from our team.

You have Successfully Subscribed!