Disable/Lock Certain Package Updates Using Yum Command

[root@worker1 ~]# cat /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=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&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


append to above file 

exclude=python-3*        [Exclude Single Package]
exclude=httpd php        [Exclude Multiple Packages]





[root@worker1 ~]# yum install httpd php
Loaded plugins: fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 9.6 kB     00:00     
 * base: mirrors.praction.in
 * epel: ftp.jaist.ac.jp
 * extras: mirrors.praction.in
 * updates: mirrors.praction.in
Kubernetes                                               | 1.4 kB     00:00     
base                                                     | 3.6 kB     00:00     
extras                                                   | 2.9 kB     00:00     
updates                                                  | 2.9 kB     00:00     
No package httpd available.
No package php available.
Error: Nothing to do
[root@worker1 ~]# yum update httpd php
Loaded plugins: fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
 * base: mirrors.praction.in
 * epel: repos.del.extreme-ix.org
 * extras: mirrors.praction.in
 * updates: mirrors.praction.in
No Match for argument: httpd
No package httpd available.
No Match for argument: php
No package php available.
No packages marked for update
[root@worker1 ~]# 

Comments

Popular posts from this blog

ansible redhat cluster qorum qdevice

PE 3.9.0 on centos 6

gfs2 cluster