Skip to content

Instantly share code, notes, and snippets.

@apinter
Created May 25, 2022 23:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apinter/c6c1f786414ec8f67e21d39629efbedf to your computer and use it in GitHub Desktop.
Save apinter/c6c1f786414ec8f67e21d39629efbedf to your computer and use it in GitHub Desktop.
  1. Create a systemd service and a timer unit with the below contents
  2. The unit runs with the user so create the unit and timer under $HOME/.config/systemd/user/
  3. Enable the timer only (systemctl enable --user --now update-user-flatpaks.timer)
  4. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment