elementary OS 5.1 doesn’t automatically update Flatpak applications. Given the arbitrary appearance of updates, it’s a bit bothersome to be nagged about updates all day. Flatpak doesn’t provide an auto-update mechanism but instead leaves this up to software apps. GNOME Software has had this functionality baked-in since GNOME 3.30, for instance, according to the Phoronix article GNOME Software 3.30 Will Automatically Update Flatpaks By Default. Since I don’t want to have multiple app stores on my machine, I opted for using systemd to update Flatpaks.

Tutorial

The instructions here describe how to create systemd service and timers to automate updating both user and system Flatpak installations. The tutorial uses elementary OS 5.1 as a reference operating system but are more generally applicable to any Linux system with systemd and Flatpak. I assume you are familiar with these concepts and keep things brief. Separate instructions are provided for the user and system Flatpak installations. The systemd units here were derived from those provided by marcelpaulo's GitHub comment.

The systemd user unit files are placed in the directory /etc/systemd/user/ where they are applied to all users on the system. An individual user can place the unit files in the directory ~/.config/systemd/user/ to only effect her account.

  1. Create the systemd service unit to update Flatpaks.

    User
    /etc/systemd/user/update-user-flatpaks.service
    [Unit]
    Description=Update user Flatpaks
    
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/flatpak --user update -y
    
    [Install]
    WantedBy=default.target
    System
    /etc/systemd/system/update-system-flatpaks.service
    [Unit]
    Description=Update system Flatpaks
    After=network-online.target
    Wants=network-online.target
    
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/flatpak --system update -y
    
    [Install]
    WantedBy=multi-user.target
  2. Create the systemd timer unit to automate the updates.

    User
    /etc/systemd/user/update-user-flatpaks.timer
    [Unit]
    Description=Update user Flatpaks daily
    
    [Timer]
    OnCalendar=daily
    Persistent=true
    
    [Install]
    WantedBy=timers.target
    System
    /etc/systemd/system/update-system-flatpaks.timer
    [Unit]
    Description=Update system Flatpaks daily
    
    [Timer]
    OnCalendar=daily
    Persistent=true
    
    [Install]
    WantedBy=timers.target
  3. Start the systemd timer.

    User
    ➜ systemctl --user enable --now update-user-flatpaks.timer
    Created symlink /home/jordan/.config/systemd/user/timers.target.wants/update-user-flatpaks.timer → /etc/systemd/user/update-user-flatpaks.timer.
    System
    sudo systemctl --system enable --now update-system-flatpaks.timer
    Created symlink /etc/systemd/system/timers.target.wants/update-system-flatpaks.timer → /etc/systemd/system/update-system-flatpaks.timer.

Conclusion

You have removed a bit of distraction from your day. With any luck, it wasn’t even too difficult.