Exclude Specific Packages From Yum Update In RHEL/CentOS

Exclude Specific Packages From Yum Update In RHEL/CentOS

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*

READ More Relevant Stuff:  Slax 11.2 Released

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *