linux禁止自动更新

一、centos

1、全部禁止

yum install yum-cron
vim /etc/yum/yum-cron.conf

update_messages = no
download_updates = no

2、部分禁止

禁止部分更新,编辑 /etc/yum.conf [main]下加上exclude=http* php* mysql*,保存,应该是禁止更新apache,php,mysql

[root@node1 k8s]# 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
exclude=http* php* mysql*

二、ubuntu

安装kubeadm、kubectl、kubelet
apt-get install -y kubelet=1.23.1-00 kubeadm=1.23.1-00 kubectl=1.23.1-00
阻止自动更新(apt upgrade时忽略)。所以更新的时候先unhold,更新完再hold

你可能感兴趣的:(linux,centos,apache,php)