Add option to allow "offline" updates for Flatpak packages, possibly AUR

Archwiki suggests using a systemd service and timer to update Flatpak applications and runtimes
automatically

ArchWiki - Flatpak - Automatic updates via systemd

Warning
It is generally not a good idea to run unattended updates via systemd, as the applications can get new permissions without the user aware of the changes. See this blogpost for examples.

To update your system runtimes and applications automatically, create the following files:

# /etc/systemd/system/flatpak-update.service

[Unit]
Description=Update Flatpak
After=network-online.target
Wants=network-online.target

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

[Install]
WantedBy=multi-user.target
# /etc/systemd/system/flatpak-update.timer

[Unit]
Description=Update Flatpak

[Timer]
OnBootSec=2m
OnActiveSec=2m
OnUnitInactiveSec=24h
OnUnitActiveSec=24h
AccuracySec=1h
RandomizedDelaySec=10m

[Install]
WantedBy=timers.target

Afterwards, do a daemon-reload and enable/start the flatpak-update.timer unit

systemctl daemon-reload
systemctl enable --now flatpak-update.timer

Note
This guide is for system flatpak installations which are the default in flatpak.
For user flatpak installations:

  • Create the above files in the /etc/systemd/user/ directory.
  • Add the --user flag in ExecStart line in flatpak-update.service.
  • Run the systemctl commands with the --user flag.
1 Like

That’s nice, and is certainly effective. I guess I’ll use that for now.

But it would be nice if pamac managed this somehow, seeing as a similar setting for offline updates is available for repository package upgrades right now (as mentioned in the original post).

If the systemd timer and service work as expected they can be implemented by any user that can copy/paste content from previous post to a text editor

sudo nano /etc/systemd/system/flatpak-update.service
sudo nano /etc/systemd/system/flatpak-update.timer

If that is considered safe and effective for new users, Manjaro Team might be able to deploy it as a BASH script or standalone package

If the systemd timer and service work as expected, changing pamac GUI plugin for Flatpak updates would not be needed

If additional features are added to pamac GUI new users might incorrectly assume that Manjaro supports Flatpak similar to repository packages. Flatpaks cannot be tested or curated like repository packages and issues should be reported to upstream maintainers

3 Likes

It does work well, a Manjaro package that makes installing this service and timer would make this simpler for users. This could potentially be a default package for new installs as well.

1 Like

We already have such a system available, called Manjaro Summit: Manjaro Summit public Alpha now available

There the user will use arkdep to maintain the system. It is fully image based and uses flatpaks for additional applications. When there is an update, you can download it, but it only gets applied on a fresh boot of the machine. If that new update won’t work, you can select the previous state of the system.

Initial products shipping this style of Manjaro will be:

Most likely expected in Q4-2025.

1 Like

Sure, I get that Manjaro Summit exists, but I was wanting a solution for the existing stable branch.
Especially seeing as Flatpaks are independent of system packages, so there should be no harm to the system in automatically upgrading Flatpaks.

Also Summit doesn’t seem quite ready yet (its in alpha).

No - no - no - automatic updates always bear the potential to cause harm - no matter the method.

What is defined as harm is an open question.

Keeping a Manjaro system in a sane and working state is the local system administrators duty.

Manjaro provides updated packages - but whether to apply them or not - that is the local system administrators decision.

Yes - Pamac provides an option to do offline update - if you make use of it - fine - it is your system.

If you want automatic updates - you can script it - and if you run into issues - you have only yourself to thank.

Manjaro Summit is a completely different concept.

There is no updates to the system as such - it is a concept similar to macOS where the base system is a single unit - it is downloaded as a single unit and deployed as a single unit.

You cannot make changes to that unit and as such the replacement is atomic - it is all or nothing.

1 Like

Everything that can be said has already been said.
Manjaro isn’t a household appliance. It requires ongoing maintenance.