This article will describe auto update with PackageKit and YaST Online Update Configuration.
Table of Contents
1 Disable auto update
PackageKit does auto update by default. /usr/lib/packagekitd by packagekit.serivce disturbs running zypper.
> sudo zypper -n install git PackageKit is blocking zypper. This happens if you have an updater applet or other software management application using PackageKit running. Tell PackageKit to quit? [yes/no] (no): no System management is locked by the application with pid 1573 (/usr/lib/packagekitd). Close this application before trying again.
You must uninstall PackageKit for disabling packagekit.service because packagekit.service is static systemd units. Uninstalling PackageKit will uninstall Apper.
> sudo zypper -n remove PackageKit
2 PackageKit
PackageKit runs auto update by default. This auto update interval is fixed by the following files.
/etc/cron.daily/packagekit-background.cron /usr/lib/systemd/system/packagekit.service
/etc/cron.daily/packagekit-background.cron is set by /etc/sysconfig/packagekit-background. packagekit-background is disabled by default. The interval is fixed to daily.
There is a issue that packagekitd by packagekit.service will lock of zypper for a while on boot. packagekit.service is static systemd units which cannot be disabled.
> systemctl status packagekit packagekit.service - PackageKit Daemon Loaded: loaded (/usr/lib/systemd/system/packagekit.service; static) Active: inactive (dead)
3 YaST Online Update Configuration
"YaST Online Update Configuration" runs auto update too.
Install yast2-online-update-configuration.
> sudo zypper -n in yast2-online-update-configuration
Run YaST for configuration.
> sudo yast
After installing yast2-online-update-configuration, "Online Update Configuration" is added to "Software".
"Online Update Configuration" is as below.
"Online Update Configuration" do the following settings. You can do these settings non-interactively without YaST.
- Copy /usr/lib/YaST2/bin/online_update to /etc/cron.[interval]/opensuse.org-online_update.
- Set AOU_AUTO_AGREE_WITH_LICENSES and AOU_INCLUDE_RECOMMENDS in /etc/sysconfig/automatic_online_update. If AOU_ENABLE_CRONJOB is false, /etc/cron.[interval]/opensuse.org-online_update does not do update.
3.1 Auto update at specific timing
Uninstall PackageKit and install yast2-online-update-configuration. Set /etc/sysconfig/automatic_online_update. Register cron job which runs /usr/lib/YaST2/bin/online_update.