I may be totally confused but I’ve also always done it in that order, otherwise I feel like it would run upgrades from your cache of the apt repos (possibly hitting errors as stuff likes to change), then after it would run apt update (updating the repos).
My thought has always been update repos, then check those repos for software upgrades. I could definitely be wrong though.
&& executes the second command, if the command before was successful, || executes the second command if the first one was unsuccessful and ; executes the second command regardless of success.
Fun fact and disclaimer: this is a fork bomb. i tried it to run it on my phone via termux, thinking android would act up and terminate termux; but nope, my phone froze. Thankfully i hard-reset my phone by holding [VOLUME_DOWN]+[POWER] for ~5 seconds.
You can also add a package name to install it at the same time as doing the upgrade, though personally I prefer to do that as a separate command so I can see what dependencies are needed.
Are you serious? That’s a thing? I’ve been doing apt update and apt upgrade for years
Yes.
Also don’t forget && exists for sequential completion of any commands
Yeah, I was doing
sudo apt update && sudo apt upgrade
I may be totally confused but I’ve also always done it in that order, otherwise I feel like it would run upgrades from your cache of the apt repos (possibly hitting errors as stuff likes to change), then after it would run apt update (updating the repos).
My thought has always been update repos, then check those repos for software upgrades. I could definitely be wrong though.
Presumably running upgrade with the update flag does it all in one go.
&&
executes the second command, if the command before was successful,||
executes the second command if the first one was unsuccessful and;
executes the second command regardless of success.I didn’t know any of this, thank you both :)
These are much more useful than the :() :;: operator
Expanded it’s more clear what’s going on.
bomb() { bomb | bomb & } bomb
Fun fact and disclaimer: this is a fork bomb. i tried it to run it on my phone via termux, thinking android would act up and terminate termux; but nope, my phone froze. Thankfully i hard-reset my phone by holding [VOLUME_DOWN]+[POWER] for ~5 seconds.
I’m absolutely serious.
You can also add a package name to install it at the same time as doing the upgrade, though personally I prefer to do that as a separate command so I can see what dependencies are needed.