How is this not a built-in function of pacman?

  • HogGirl@sh.itjust.worksOP
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 days ago

    Thanks for answering. I guess having a laptop fully charged but not on AC-power doing even the smallest update still enters sleep for some reason, even during installation of new files for me

    • moonpiedumplings@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      ·
      21 hours ago

      When I desire to inhibit sleep, whether for an update via pacman, or for nix home manager, or any other reason, I usually use KDE’s power management widget. The advantage of this, as opposed to something pacman specific, is that it is explicit, activating and stopping when I want it to, which also makes it more general, and it can be used for anything.

      You can also manually do this (on systemd distros at least) via the systemd-inhibit command, which can wait for a command to finish.

      sudo systemd-inhibit --what=shutdown:sleep --mode=block pacman -Syu
      

      EDIT Oop someone already mentioned systemd-inhibit in another commend. And their answer is even shorter than mine and apparently still works.