Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

As far as I know during maintenance window our servers get new packages of software installed. (I checked 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...

I have searched on Google but didn't find any info about that.

Thanks.

like image 660
goodguy Avatar asked May 25 '26 14:05

goodguy


1 Answers

The centOS 7 image used in Compute Engine includes the yum-cron installed and enabled by default. 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.

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. 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.

sudo yum remove yum-cron

This part is missing in the official documentation so It will be added soon.

like image 57
Pit Avatar answered May 27 '26 12:05

Pit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!