sudo
and -h
is not needed. To shutdown system with a 15 minute delay:
$ shutdown +15
Shutdown scheduled for Sun 2024-03-17 17:46:59 GMT, use 'shutdown -c' to cancel.
But for updating packages, it would be better to inhibit system sleeping, shutdown and idle :
systemd-inhibit pamac update --no-aur
Or build pacman-systemd-inhibit from AUR
For more immunity from PEBCAK issues, disable power button and laptop lock-switch so they cannot be used to shutdown system, and learn how to reboot/shutdown a system safely
[HowTo] reboot / turn off your frozen computer: REISUB/REISUO
If mains power is not reliable for updating a desktop system, get an Uninterruptible Power Supply