basic systemd tut

basic systemd tut

basic systemd timer to auto-update flatpak snap and appimage

Set once, forget about it. A basic systemd timer that runs flatpak, snap, and appimage updates on a schedule without you having to remember.

July 26, 2026 · 3 min

Most people manually update stuff when they remember. But you can make your system do it automatically with a couple of files.

I was looking at keeping on top of flatpak, snap, and appimage updates and realised I just forget to do it. Found this solution using systemd timers, pretty straightforward.

What we’re building

Two files that work together:

  • A bash script that runs the actual updates
  • A systemd timer that says when to run it

That’s it. No daemons running constantly, no cron job headaches, just systemd doing what it’s built for.

Step 1: Create the update script

Open terminal and run this to create the file:

sudo nano /usr/local/bin/auto-app-updates.sh

Paste this into nano:

#!/usr/bin/env bash
set -e

echo "==> starting app updates at $(date)"

# flatpak
if command -v flatpak &> /dev/null; then
    echo "updating flatpak apps..."
    flatpak update -y
    echo "flatpak done"
fi

# snap
if command -v snap &> /dev/null; then
    echo "updating snap..."
    snap refresh
    echo "snap done"
fi

# appimage (if you have a standard location for them)
if [ -d ~/AppImages ]; then
    echo "checking appimages..."
    for appimage in ~/AppImages/*.AppImage; do
        if [ -f "$appimage" ]; then
            echo "found: $appimage"
        fi
    done
    echo "appimage check done"
fi

echo "==> app updates finished at $(date)"

Save and exit nano: Ctrl+X, then Y, then Enter.

Make it executable:

sudo chmod +x /usr/local/bin/auto-app-updates.sh

Test it works:

sudo /usr/local/bin/auto-app-updates.sh

Step 2: Create the systemd service

Run this:

sudo nano /etc/systemd/system/auto-app-updates.service

Paste this:

[Unit]
Description=Auto-update flatpak snap and appimage
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/auto-app-updates.sh
StandardOutput=journal
StandardError=journal

Save and exit: Ctrl+X, Y, Enter.

Step 3: Create the systemd timer

Run this:

sudo nano /etc/systemd/system/auto-app-updates.timer

Paste this:

[Unit]
Description=Run app updates daily
Requires=auto-app-updates.service

[Timer]
OnCalendar=daily
OnCalendar=*-*-* 02:00:00
Persistent=true

[Install]
WantedBy=timers.target

Save and exit: Ctrl+X, Y, Enter.

This runs at 2am every day. Change 02:00:00 to whatever time you want (24-hour format).

Step 4: Enable and start

Run these commands:

sudo systemctl daemon-reload
sudo systemctl enable auto-app-updates.timer
sudo systemctl start auto-app-updates.timer

Check it’s running:

sudo systemctl status auto-app-updates.timer

See when it runs next:

systemctl list-timers auto-app-updates.timer

That’s it

Your system will now automatically update flatpak, snap, and appimage apps every day at 2am.

Verify it worked

Check the logs after it runs:

sudo journalctl -u auto-app-updates.service -n 20

Change the schedule

To run at a different time, edit the timer:

sudo nano /etc/systemd/system/auto-app-updates.timer

Change this line:

OnCalendar=*-*-* 02:00:00

Then reload:

sudo systemctl daemon-reload
sudo systemctl restart auto-app-updates.timer

Only want flatpak or snap?

Edit the script and comment out or delete what you don’t need:

sudo nano /usr/local/bin/auto-app-updates.sh

Remove the flatpak section, snap section, or appimage section. Save and done.

Troubleshooting

Check logs for errors:

sudo journalctl -u auto-app-updates.service

Check if timer is active:

sudo systemctl status auto-app-updates.timer

Make sure filenames are exactly right:

  • /etc/systemd/system/auto-app-updates.service
  • /etc/systemd/system/auto-app-updates.timer
  • /usr/local/bin/auto-app-updates.sh

Leave a Reply

Your email address will not be published. Required fields are marked *

*