Pages

Friday, June 23, 2017

Disable Certain Package Updates using YUM in RHEL / CentOS / Fedora

YUM (Yellowdog Updater Modified) is an open source default package management system for several Linux flavors like RHEL (Red Hat Enterprise Linux), CentOS (Community Enterprise Operating System)and Fedora. The YUM utility is used installupgraderemove rpm based packages from the distribution repositories in systems.
But sometime we don’t want to do update certain packages such as Apache Server (HTTP), MySQLPHP and other major applications, because if such updates may harm currently running web application on server or you may stop updates till the application gets patched with new updates.

YUM Exclude Packages
YUM Exclude Package Updates

In this article we will show you how we can exclude (disable) certain package updates using YUMtool. We can exclude or disable certain package updates from the any third party repositories. The exclude syntax would be as follow.
exclude=package package1 packages*
The above syntax will exclude “package“, “package1” and list of “package” updates or installs. Each keyword should be separated with space for exclusion of packages.

How to Exclude Packages in YUM

To exclude (disable) specific package updates, Open file called /etc/yum.conf with your choice of editor.
# vi /etc/yum.conf
Add the following line at the bottom of the file with exclude keyword as shown below.
[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=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# This is the default, if you make this bigger yum won't see if the metadata 
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
## Exclude following Packages Updates ##
exclude=httpd php mysql
In the above example, the line exclude will disable updates for “httpd” “php” and “mysql” packages. Let’s try installing or updating one of them using YUM command as shown below.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n6Z3G
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment