Skip to content

Commit 9a918e2

Browse files
committed
Document manual update mechanisms
1 parent d1ce882 commit 9a918e2

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

FAQ.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ _If you don't find what you're looking for, and you think it should be covered b
1717
- [How do I install Zsh on Windows?](#how-do-i-install-zsh-on-windows)
1818
- [How do I install Oh My Zsh?](#how-do-i-install-oh-my-zsh)
1919
- [How do I install Oh My Zsh globally?](#how-do-i-install-oh-my-zsh-globally)
20+
- [How do I update Oh My Zsh?](#how-do-i-update-oh-my-zsh)
21+
- [How do I manually update Oh My Zsh from a script?](#how-do-i-manually-update-oh-my-zsh-from-a-script)
2022
- [How do I uninstall Oh My Zsh?](#how-do-i-uninstall-oh-my-zsh)
2123
- [How do I change my locale?](#how-do-i-change-my-locale)
2224
- [How do I reload the zshrc file?](#how-do-i-reload-the-zshrc-file)
2325
- [How do I reset the completion cache?](#how-do-i-reset-the-completion-cache)
24-
- [How do I manually update Oh My Zsh from a script?](#how-do-i-manually-update-oh-my-zsh-from-a-script)
2526
- [Common problems](#common-problems)
2627
- [Installation](#installation)
2728
- [I can't access the installer / connection timed out](#i-cant-access-the-installer--connection-timed-out)
@@ -129,6 +130,39 @@ plugins=(...)
129130
source "$ZSH/oh-my-zsh.sh"
130131
```
131132

133+
#### How do I update Oh My Zsh?
134+
135+
Oh My Zsh automatically updates itself if left at the default settings. You can check out [[Settings]] for more information on how to change the update settings.
136+
137+
If you want to manually update Oh My Zsh, you have 2 options:
138+
139+
- If running within your shell, you can use the CLI tool `omz` to force an update and restart the shell session:
140+
141+
```sh
142+
omz update
143+
```
144+
145+
- If you want to update Oh My Zsh as part of an automated script, its better to use the `upgrade.sh` script directly. You can call it with any of these alternatives:
146+
147+
```sh
148+
"$ZSH/tools/upgrade.sh" # $ZSH needs to be defined within the script
149+
zsh "$ZSH/tools/upgrade.sh"
150+
/path/to/ohmyzsh/tools/upgrade.sh
151+
```
152+
153+
This script also allows you to pass in 2 separate flags to control its behavior:
154+
155+
- `-i`: tells the script to upgrade interactively. In this mode, the only change is that the changelog will be displayed after the update.
156+
- `-v default|minimal|silent`: control the verbosity of the script. This is equivalent to the [verbosity](https://github.com/ohmyzsh/ohmyzsh/wiki/Settings#omzupdate-verbosity) settings.
157+
158+
> [!IMPORTANT]
159+
> To upgrade Oh My Zsh, you need to have `git` installed and it needs to be installed as a git repository.
160+
> It is also required to be running with a user that has write access to the Oh My Zsh installation directory.
161+
162+
#### How do I manually update Oh My Zsh from a script?
163+
164+
See [the section above](#how-do-i-update-oh-my-zsh).
165+
132166
#### How do I uninstall Oh My Zsh?
133167

134168
To remove Oh My Zsh, run `uninstall_oh_my_zsh`. The uninstaller will:
@@ -215,16 +249,6 @@ rm "$ZSH_COMPDUMP"
215249
exec zsh
216250
```
217251

218-
#### How do I manually update Oh My Zsh from a script?
219-
220-
The best way to do that is to call the `upgrade.sh` script directly. If `$ZSH` is defined (it should point to where OMZ is installed), then you can call it like so:
221-
222-
```sh
223-
"$ZSH/tools/upgrade.sh"
224-
```
225-
226-
Another option is to use the `omz` CLI. The `omz update` command triggers an update, but it also shows the changelog and restarts the zsh session (which _might_ cause a restart loop). To avoid that, run it with the `--unattended` flag, like so: `omz update --unattended`. But again, it's better to call the `upgrade.sh` script directly.
227-
228252
## Common problems
229253

230254
### Installation

0 commit comments

Comments
 (0)