When updating your Mac, you usually have to go through the App Store to do it. This can be annoying because it takes around 20 minutes to do each update and you can’t use your Mac at the same time. But did you know there’s a way to do it via the command line interface?
The utility you can use to do this is called ‘softwareupdate’ and it’s pretty powerful, but we only need one command to check for and install updates:
softwareupdate -ia
If you’re interested in the other features this utility offers, you can run:
softwareupdate -?
Tips:
If you’re interested in being able to check for updates and install them and then reboot automatically afterwards you can add the following line to your ~/.bash_profile file with your favourite text editor such as ee, vim, or nano.
alias update='sudo sh -c "softwareupdate -ia && reboot"'
Then save and exit the file and run the following to re-load your .bash_profile file.
source ~/.bash_profile