Systemd-inhibit yay --noconfirm

I use systemd-inhibit to prevent my system going to sleep during package updates. I have tried “yay --noconfirm” to automate the process. Unfortunately systemd-inhibit appears to stop --noconfirm from working. Is there a workaround? I have the following in my .bashrc.

alias yay=‘yay --noconfirm’
alias update=‘systemd-inhibit yay -Syu --cleanafter --sudoloop && paccache -rk1 && systemd-inhibit flatpak update -y && flatpak uninstall --unused -y’

I think the following issue that has been merged last week is relevant. So a fix could be about to be released.

Just a friendly warning that automating updates of repo packages on any Arch-based distro is highly risky. There are sometimes important choices you need to make manually or be aware of during the update process.

It is your system so you are free to do what you want but don’t be surprised if your system is unbootable one day.

2 Likes

I agree that I will end up with an unbootable system by doing unattended updates (I don’t automate updates; I manually trigger the updates.). It’s not a case of if but when. The upside is that I don’t have to sit at my keyboard selecting what are the default choices 99.9% of the time.

I mitigate that risk by using btrfs so I can rollback to a previous system state at boot. I appreciate that wouldn’t have worked with the grub update problem, but it is relatively rare that an upgrade gone wrong will take out the ability to rollback at boot.