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

  • hendrik ( hendrik@palaver.p3x.de ) 
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 hours ago

    I think other packet managers don’t, either.

    As an upside you won’t run into situations like a big Windows update blocking the entire computer 20mins before your meeting and you’d really need to close the lid, throw it in the backpack and walk to the meeting room. Or you spontaneously talk to someone and return to a laptop with a drained battery. Probably more of an issue with automatic-upgrades, though.

  • Cousin Mose ( undefined@lemmy.hogru.ch ) 
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    4 hours ago

    I don’t remember what the Linux equivalent is but in macOS I just prefix commands with caffeinate. It’s super helpful when I want to do things like restore a large database then walk away. I can’t imagine it doesn’t exist on Linux.

  • Why should it?

    Downloads are interrupted by sleep, but they can be safely interrupted.

    Installing packages or other core changes are not interrupted by entering sleep mode. Although, they would be interrupted by shutdown/rebooting, sometimes to catastrophic consequences.

    Other distros are a bit more resilient, with things like installing and managing multiple kernels, that way even if one breaks (like via a borked/interrupted update), you can still boot.

    But pacman/Arch Linux is designed with a certain philosphy in mind. You are supposed to be reading the pacman output, that way you can respond if anything needs to be done. If you don’t respond accordingly when certain manual changes are needed, then bad things can happen. For example, if the grub package gets updated, then you might need to manually generate a new grub config file. If the grub config file and grub itself are out of sync, your system could be rendered unbootable.

    https://wiki.archlinux.org/title/Arch_Linux#User_centrality

      • 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

    • HogGirl ( exupulosion@sh.itjust.works ) OP
      link
      fedilink
      English
      arrow-up
      4
      ·
      9 hours 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