Autoupdate Flatpaks

systemd services to automatically update user flatpaks each 6h (by default)

  1. Create the updater service
1
systemctl --user edit --full --force flatpak-user-update.service
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[Unit]
Description=Flatpak Automatic Update
Documentation=man:flatpak(1)
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --user update -y --noninteractive

[Install]
WantedBy=multi-user.target
  1. Install a timer
1
systemctl --user edit --full --force flatpak-user-update.timer
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[Unit]
Description=Flatpak Automatic Update Trigger
Documentation=man:flatpak(1)

[Timer]
OnBootSec=5m
OnCalendar=0/6:00:00
Persistent=true

[Install]
WantedBy=timers.target
  1. Enable the timer
1
2
systemctl --user daemon-reload
systemctl --user enable --now flatpak-user-update.timer

Source