I don’t want the system to shutdown in the middle of the upgrade, but I’ve already started the upgrade in the GUI.

Is there a better way, maybe involving the apt lock?

EDIT: Thank you for all the helpful suggestions. Hopefully this helps the next person. My upgrade actually finished on its own while I was posting. 😂

  • TwilightKiddy@programming.dev
    link
    fedilink
    English
    arrow-up
    33
    ·
    edit-2
    2 days ago

    Your GUI tool is probably running apt under the hood. You can find the PID of the apt process and do something like this:

    waitpid <pid> && poweroff
    

    If you are afraid it has something to do after the apt process dies, you can add some additional arbitrary delay like this:

    waitpid <pid> && sleep <seconds> && poweroff
    
    • TwilightKiddy@programming.dev
      link
      fedilink
      English
      arrow-up
      11
      ·
      edit-2
      2 days ago

      @sem@piefed.blahaj.zone

      Alternatively, you can wait until there are no processes matching a regex with pidwait <regex>.