Exclude some packages from update

During update process RH based distros will always try to update all installed packages. Sometimes it is not recommended to do that. For example default Postfix goes without quota patch and without Mysql support. Also update process will install even 32b files and your system is 64bit, etc.

To solve this problem you can add exclude=package* to yum update command

# yum --exclude=package* update

For example

# yum --exclude=postfix* update

or

# yum --exclude=kernel* update

Also, if you don’t want to think about this, you can add exclude in yum.conf file under [main] section

# nano /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
exclude=postfix* kernel* php*
 
# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h
 
# Default.
# installonly_limit = 3
 
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

If you don’t want to mess up with i386 i586 or i686 files add exclude=*.i386 *.i586 *.i686 to yum.conf

I hope this post was helpful to you…

Leave a Reply

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