# Switch Versions of a Brew Formula

If you've installed a couple versions of a program via brew and you'd like to switch from the currently linked version to the other installed version, you can use the `switch` command. For instance, if you are on version `1.8.2` of `phantomjs` and you'd like to switch to `1.9.0`, you can simply invoke:

```
$ brew switch phantomjs 1.9.0
```

More generically:

```
$ brew switch <formula> <version>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/os/unix/package-management/switch-versions-of-a-brew-formula.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
