简体   繁体   English

谷歌云计算引擎 - 禁用自动更新(centos)

[英]Google cloud compute engine - disable automatic updates (centos)

I wonder if there is a way to disable automatic updates of our Linux machines on Google Cloud (yum update)我想知道是否有办法禁用 Google Cloud 上 Linux 机器的自动更新(yum update)

As far as I know during maintenance window our servers get new packages of software installed.据我所知,在维护 window 期间,我们的服务器安装了新的软件包。 (I checked yum.log). (我检查了 yum.log)。 Since our installed software must be specific version (not latest) we don't want Google to run updates for us because it usually breaks all kind of dependencies...由于我们安装的软件必须是特定版本(不是最新版本),我们不希望 Google 为我们运行更新,因为它通常会破坏所有类型的依赖项......

I have searched on Google but didn't find any info about that.我在谷歌上搜索过,但没有找到任何相关信息。

Thanks.谢谢。

The centOS 7 image used in Compute Engine includes the yum-cron installed and enabled by default . Compute Engine 中使用的 centOS 7 映像包括默认安装和启用的 yum-cron。 You can verify it by either using one of the following commands:您可以使用以下命令之一来验证它:

sudo yum list installed yum-cron
sudo systemctl status yum-cron.service

The yum-cron will periodically check for updates and apply them if there are updates available. yum-cron 将定期检查更新并在有可用更新时应用它们。

Solution解决方案

If you have yum-cron running on your instance, you can disable auto-updates by accessing the configuration file /etc/yum/yum-cron.conf.如果您的实例上运行 yum-cron,您可以通过访问配置文件 /etc/yum/yum-cron.conf 来禁用自动更新。 Then change the following variables to 'no':然后将以下变量更改为“否”:

update_messages = no
download_updates = no
apply_updates = no

This will prevent the system from updating automatically.这将阻止系统自动更新。

As an alternative, you can opt for uninstalling the package on your system using the following command.作为替代方案,您可以选择使用以下命令卸载系统上的 package。

sudo yum remove yum-cron

This part is missing in the official documentation so It will be added soon.官方文档中缺少此部分,因此将很快添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM