- Create a systemd service and a timer unit with the below contents
- The unit runs with the user so create the unit and timer under
$HOME/.config/systemd/user/
- Enable the timer only (
systemctl enable --user --now update-user-flatpaks.timer
) - Flatpaks will update automatically daily, if an update missed - cause the box was off for instance - it will try it again as soon as it can run again.
Contents of update-user-flatpaks.service
:
[Unit]
Description=Update user Flatpaks
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --user update -y
[Install]
WantedBy=default.target
Contents of update-user-flatpaks.timer
:
[Unit]
Description=Update user Flatpaks daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target