# Update OSMates

Get new versions of OSMates and choose what happens to machines that are running.

## Check for updates

Choose **OSMates > Check for Updates**. During the beta, updates need a [connected beta account](https://osmates.com/docs/beta#connect-your-beta-account).

To change automatic checks and downloads, choose **OSMates > Settings**, then click **Updates**.

Only official builds check for updates. A build made from source never does.

## Finish an update with machines running

Open the new version to finish the update. With no machine or job running, it finishes on its own. Otherwise, Finish Updating OSMates lists what still runs:

1. Under **What Happens**, choose **Suspend**, **Shut Down**, or **Wait** for each machine.
2. Choose **Wait** or **Cancel** for each job.
3. Click **Finish Update**.

Suspend is the default when a machine supports it and there's room to save its memory. Click **Later** to finish another time from the library or the [menu bar](https://osmates.com/docs/app#use-the-menu-bar).

Suspended and shut-down machines start again after the update, with their windows restored. Until the update finishes, `osmates` commands exit with code 75 and say what still runs.

## Finish an update from Terminal

Requires [OSMates Pro](https://osmates.com/docs/editions#what-pro-adds).

On a Mac nobody sits at, run this in the logged-in user's session:

```sh
/Applications/OSMates.app/Contents/MacOS/OSMates --finish-update
```

The command applies the default choice to each machine and job. To pick one, add `--choose <id>=<choice>` with `suspend`, `shutDown`, `wait`, or `cancel`. `osmates status` lists each ID and the choices it offers.

The command exits with 0 once every machine is back, and 1 when the update fails. A choice that a machine or job doesn't offer gives 64.

Over ssh, start the app in the user's session, then check the result:

```sh
open -n -W -a OSMates --args --finish-update
osmates status
```

`open` doesn't pass on the app's exit code, so `osmates status` is the check.

## If an update breaks a machine

[Revert the machine to its snapshot from before the update](https://osmates.com/docs/snapshots#recover-after-an-osmates-update).

To return to the version you had, see [Go back to an earlier version](https://osmates.com/docs/snapshots#go-back-to-an-earlier-version).
