I've got a few things that I don't want to update while my graphical session is running, but would be happy to have them updated on shutdown (after my graphical session ended, while network is still up), once. So, I don't want to write a service file, enable it, and then have it run at every shutdown.
Now, I thought, OK, systemd-run to the rescue:
systemd-run \
--property=Type=oneshot \
--property=DefaultDependencies=no \
--property=Requires=network.service \
--property=WantedBy=shutdown.target \
/usr/bin/dnf5 update -y package1 packge2…
But that fails with
Failed to start transient service unit: Dependency type WantedBy may not be created transiently.
Is there another way to this?