How to update macbook pro from terminal

macos
hardware

#1

Hi,

I want to help my friend. They have 10 Apple macbook pros. I have enabled ssh on macbook pro. Can I update those using a shell script? How to update macOS based macbook pro using a simple terminal command line option? Is there such tool available macos bash shell?

Any help would be much appreciated.


#2

Open the terminal app and run the following command to see updates list:

softwareupdate -l

To apply updates simply run:

sudo softwareupdate -r
sudo softwareupdate -i -a

You can use bash for loop as follows from your terminal over ssh:

for i in mac1 mac2 mac3 mac10
do
   ssh -t user@${i} sudo softwareupdate -i -a
done

For more info see my FAQ: