So then Unix philosophy way just yes pacman -Syyu && systemctl suspend or whatever. It only runs if the update is successful, and waits until it’s finished, or pacman -Syyu; systemctl suspend if you want it to suspend regardless of success or failure
Edit: misread, thought the question was about making the computer sleep after being finished. Keeping it awake is a blessing and curse about Linux because what is keeping that specific arch build awake, lightdm? Sddm? Systemd? Ideally this would be a systemd capability, but then people would complain about more systemd ownership of bespoke os features. So then use something like https://wakepy.readthedocs.io/stable/index.html I guess otherwise you’re using KDE or gnome or whatever apps
One good reason is so that you can start an update, walk away, and it’ll run to completion.
So then Unix philosophy way just
yes pacman -Syyu && systemctl suspendor whatever. It only runs if the update is successful, and waits until it’s finished, orpacman -Syyu; systemctl suspendif you want it to suspend regardless of success or failureEdit: misread, thought the question was about making the computer sleep after being finished. Keeping it awake is a blessing and curse about Linux because what is keeping that specific arch build awake, lightdm? Sddm? Systemd? Ideally this would be a systemd capability, but then people would complain about more systemd ownership of bespoke os features. So then use something like https://wakepy.readthedocs.io/stable/index.html I guess otherwise you’re using KDE or gnome or whatever apps
The correct solution is to use systemd-inhibit to block sleep/shutdown (on systemd distros at least).
sudo systemd-inhibit --what=shutdown:sleep --mode=block pacman -SyuNeither of these actually inhibit sleep during the update though…