40
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 04 Jul 2026
40 points (100.0% liked)
Linux
14208 readers
246 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
There's no need for password-less sudo. Instead, you can use
bash -cto run a set of commands via sudo:Why do you need the
while true?Otherwise it'd only check for the lock once. It'd run, go "oops, apt is in use!", and quit, and never check again.
The loop here is what makes it check again at all.
-- Frost
I suppose it would be useful for flakey internet connection, then your update would restart 5 minutes after losing the connection. It surely has a yucky aftertaste, though.
No, the idea was that
apt updatewould keep failing while the system upgrade was running (and holding the lock):But there are better ways of waiting for a process to finish, that other people have shared
Nice. Sudo once, then run the shell until done. Much more elegant.