How To Update Mac OS X & Mac Apps From Terminal.
From time to time, you find that an update is available, either for your macOS system or for the applications installed on your computer. It is very important to keep your system software and applications up to date. This ensures that your system is stable and that your applications are free of bugs.
On a Mac, you have several ways to update your operating system and applications. The traditional way to get and install new updates is to use the official Mac App Store on your computer.
However, you are not tied to it for installing updates. You can also use the Terminal application to find, download and install various updates to your computer. There are even configurable options to let you decide how to install these updates.
Update macOS version of Terminal
Terminal has a command that checks for all available macOS updates and allows you to download and install them on your computer. This command also lets you update Apple apps like iTunes on your Mac.
However, it does not install updates for third-party applications installed on your computer. For these applications, you will need to install the package described in the later part of this guide.
Find available macOS updates
The first thing you need to do is check what updates are available for your macOS and Apple apps. Checking does not necessarily mean downloading or installing updates. Just to give you an idea of ??what needs to be updated on your Mac.
Launch the Terminal application on your Mac using your preferred method.
When the application starts, enter the following command and press Enter.
It will find all available updates and display them in a terminal window. The information that you will see includes the names of the applications, the size of the update, whether the update is recommended or not, and whether the update requires a computer restart.
You can also check for updates using the terminal and then install them from the App Store if you like.
Download macOS updates
Once you know what updates are available, you can download those updates to your Mac. Remember, downloading also does not require installing updates. You can just keep the downloaded updates and not install them right away.
- Launch the Terminal application, type the following command and press Enter.
softwareupdate -d -a
- It will download all available updates, but will not install them. You will find these update files in the / Library / Updates / folder on your Mac.
Install downloaded macOS updates
Updates that you download using the Terminal command cannot be installed manually. These updates can only be installed using a command in the Terminal application.
To install them, you need to first find out the name of the update, and then use that name below to install the update on your Mac.
- Launch the Terminal application, type the following command and press Enter. Be sure to replace update-name with the name of the update you want to install.
softwareupdate -i update-name
It will tell you when the update has been installed on your computer. It shouldn’t take long as the update has already been downloaded to your Mac and just needs to be installed.
Download and install all macOS updates
What you did in the sections above was a gradual upgrade. What if you want to find, download and install all macOS updates in one go? Well, Terminal got you covered.
There is a command that allows you to install all available updates on your Mac in one go.
- Open the Terminal application and run the following command in it.
softwareupdate -i -a
The command will install all updates and tell you when it’s done. It will take longer than the methods described above, since all updates are downloaded first and then they are installed on your computer one by one.
Update Mac Applications from Terminal
Third-party apps not developed by Apple require various commands to be updated from Terminal on your Mac. These app updates will not show up when you run the commands mentioned above.
To be able to update all Mac Store apps, you will need to install Homebrew followed by “mas” on your computer. You can then update other apps.
Open the Terminal application and run the following command in it to install Homebrew.
/ usr / bin / ruby ??-e “$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master / install)”
With Homebrew installed, type the following command and press Enter to install the mas utility.
brew install mas
After installing mas, you can run the following command to see a list of all applications that can be updated with this utility.
Type the following command and press Enter to see all applications that need updating.
Run the following command to update any legacy apps. It will download updates for all outdated apps first and then install them, so wait for a while before it completes.
Wait while the utility updates your applications. When this is done, you can close the Terminal window.
You don’t need to install mas and Homebrew on Mac unless you plan on updating apps this way in the future. Removing them will not affect the updated apps on your Mac, so they can be safely uninstalled if desired.