Is there a super-upgrade command that combines all these commands to one?
Well.. bad news is that no, there isn't. Good news though is that here I've put together one.
And to go on with the idea of simplification I've turned its creation into a "single" command line. So here it is:
echo "sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade && sudo apt -y autoremove && sudo apt autoclean" > update && sudo mv update /usr/local/bin/update && sudo chmod +x /usr/local/bin/update
Now, whenever the need for updating arises you just type update
in the terminal, input your password and voilà.
This might look like one of those incomprehensible things you only copy-paste from. But it doesn't really have to be !
See it's actually quite simple, so..
What this is :
- Every update command (and then further commands) were concatenated using
&&
(including apt autoremove
to remove no longer used dependencies).
-y
was added to every apt
command that would otherwise prompt for a positive answer to perform its actions.
echo
was placed in front of the command and the line was surrounded with ""
so its characters wouldn't escape.
>
was used to redirect/write echo
's output (our line) to an "update" file.
- The file is moved to
/usr/local/bin/
so it is executable from anywhere. Writing on this path requires superuser access which is why it's not possible to do it in the step before.
- The file was turned into an executable using
chmod
.
sudo apt-get update && sudo apt-get dist-upgrade
update
andupgrade
as one-liners askubuntu.com/a/1086022/295286