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

  • frongt@lemmy.zip
    link
    fedilink
    arrow-up
    11
    arrow-down
    2
    ·
    22 hours ago

    One good reason is so that you can start an update, walk away, and it’ll run to completion.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      3
      arrow-down
      2
      ·
      17 hours ago

      I don’t think it’s a good idea to walk away from a system update, but maybe that’s just me.

    • urushitan 漆たん@kakera.kintsugi.moe
      link
      fedilink
      arrow-up
      4
      arrow-down
      5
      ·
      edit-2
      15 hours ago

      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

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

        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 -Syu
        

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