How to Update Apps using Terminal on a Mac

If you administer a number of Macs, running common tasks through the command line can reduce your maintenance workload. Using a combination of system commands and open-source repositories, you can update both macOS software and Mac App Store software using Terminal.

You can update built-in macOS software using the softwareupdate command in Terminal.

1. Open Terminal (Application/Utilities/Terminal.app).

macos-window-management-terminal-fix-1

2. Type the following command and press “Enter:”

softwareupdate -l

terminal-update-software-softwareupdate-1

This will list all the macOS software updates that are currently available for your system.

3. Wait for a moment while it searches the macOS servers for updates.

terminal-update-software-softwareupdate-3

4. If updates are available, softwareupdate will tell you which updates are available. If no updates are available, you’ll be returned to the command prompt.

terminal-update-software-softwareupdate-2

5. To install all available updates, type the following command and press “Enter:”

sudo softwareupdate -ia --verbose

terminal-update-software-softwareupdate-4a

6. Type your password when prompted and press “Enter.”

7. The update process will now run, displaying each program’s progress as it is updated.

terminal-update-software-softwareupdate-6

8. When the update process is finished, you’ll be returned to the command prompt.

terminal-update-software-softwareupdate-7

Softwareupdate Flags

  • The --verbose flag is optional, but it will give live status reports as updates are installed. If you have a lot of updates to process, this flag will keep you abreast of the current status.
  • The -i flag stands for “install” and will begin the installation process for selected apps
  • The -a flag stands for “all.” This will install all available updates.
  • The -r flag stands for “recommended.” For example, softwareupdate -ir will install only “recommended” updates.
  • The -h flag stands for “help” and will reveal all available commands.
  • To install just one update, use
    softwareupdate -i [package name]

    For example, softwareupdate -i RemoteDesktopClient-3.9.2 will install only the RemoteDesktopClient 3.9.2 update.

  • To ignore specific updates, use the --ignore flag. For example:
    softwareupdate --ignore RemoteDesktopClient-3.9.2

    will hide the 3.9.2 update of RemoteDesktopClient. You’ll be alerted when a new update is available.

By default, macOS does not contain a command line utility for updating apps from the Mac App Store. However, you can install Dmitry Rodionov’s mas utility to add this functionality to your command line.

1. Open Terminal (Application/Utilities/Terminal.app).

macos-window-management-terminal-fix-1

2. If you don’t already have the Homebrew package manager installed, you’ll need to get it. Install Homebrew using the Terminal command below:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

homebrew-package-manager-macos-1

You can also follow our guide for getting set up with Homebrew.

3. Use the following command to install mas-cli from the Homebrew database:

brew install mas

terminal-mas-install

4. When the installation is complete and you have your command prompt back, you can type in mas to see a list of all available mas commands.

terminal-mas-commands

5. Type the following command to see a list of installed Mac App Store apps. There might be a few of them.

mas list

terminal-mas-list

6. Type the following command to see all apps with updates available:

mas outdated

terminal-mas-outdated

7. Type the following command to update all apps with updates available:

mas upgrade

terminal-mas-upgrade

8. mas will run through the upgrade process for each app.

terminal-mas-upgrade-2

9. When the update process is complete, you’ll be returned to the command prompt.

terminal-mas-upgrade-3

If you need to update the built-in macOS software, or even macOS itself, you can use softwareupdate to complete that process from the command line. If you need to update apps from the App Store, you can install mas to get that done via Terminal.

Leave a Reply

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.