this post was submitted on 04 Jul 2026
41 points (100.0% liked)
Linux
14257 readers
449 users here now
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If you can run sudo without a password, you could do something like:
sudo apt update && sudo shutdown -h 5
The && operator will only execute the next instruction if the first returns a zero (no error) code upon completion.
Then just run that command about every 5 minutes and it'll shut down once the install dishes, which releases the lock so apt upgrade can go (presuming apt upgrade needs the lock - I don't remember if it does.)
Alternatively, you could ps auxw | grep for the pid of the upgrade. Then keep running a ps for that pid, and once you don't see it, shutdown.
I was today years old when I learned that
&&on the command line is not just a after this do this shortcut, but rather how it is used literally everywhere else sort of thing. I am not a very bright knife in the shed.||has a similar "oh that's how it works in other places" behavior. I didn't realize that for a while.Yeah I feel pretty silly. I have a good amount of programming experience too, which certainly amplifies the whoosh lol