Oh My Zsh - Disable 'Would you like to check for updates' prompt

Command LineZsh

Command Line Problem Overview


Every time I open up terminal on a Mac I get the prompt

> Would you like to check for updates?

I find it quite annoying. Anyway to stop it from doing so?

Command Line Solutions


Solution 1 - Command Line

Set environment variable DISABLE_UPDATE_PROMPT=true to always reply Yes and automatically upgrade.

Set environment variable DISABLE_AUTO_UPDATE=true to always reply No and never upgrade.

Simply add one of these in your ~/.zshrc somewhere before calling source $ZSH/oh-my-zsh.sh.

Solution 2 - Command Line

You have to add DISABLE_AUTO_UPDATE="true" on your .zshrc before the source $ZSH/oh-my-zsh.sh line. By doing so, oh-my-zsh will just skip the update checking script.

Solution 3 - Command Line

Deprecation in some other answers

Other answers might reference deprecated method for updating the settings.

As per OhMyZsh wiki, there is a section talking about Deprecated settings.

> These settings are still supported but will be removed in a future > version of Oh My Zsh. Migrate to the zstyle settings while you still > can.

For example, the following two methods achieve the same result:

A. Deprecated method for modifying Settings (Environment Variable in .zshrc)
DISABLE_AUTO_UPDATE=true
zstyle ':omz:update' mode disabled

I'm surprised no one mentioned the new and fine-tuned controls over OhMyZsh updates, that deprecates the old method.

This of course does not prevent you from invoking zstyle from .zshrc.

You can try the following commands that are stated by OMZ docs:

OMZ Docs -- Getting Updates

You have several options to tweak OMZ updates.

  • By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by adding a line to your ~/.zshrc file, before Oh My Zsh is loaded:

  • Automatic update without confirmation prompt:

zstyle ':omz:update' mode auto
  • Just offer a reminder every few days, if there are updates available:
zstyle ':omz:update' mode reminder
  • To disable automatic updates entirely:
zstyle ':omz:update' mode disabled
  • NOTE: you can control how often Oh My Zsh checks for updates with the following setting:
# This will check for updates every 7 days
zstyle ':omz:update' frequency 7
# This will check for updates every time you open the terminal (not recommended)
zstyle ':omz:update' frequency 0

IMPORTANT (zstyle precondition)

  • Do note, the commands above (zstyle) have to be executed strictly from within an OhMyZsh shell.
  • In other words, after installing ZSH and OhMyZsh, maybe you decided not to change your default shell to ZSH.
  • In that particular case, you have to switch your shell temporarily to ZSH for the above commands to work. You can do that with exec /bin/zsh, this probably applies to .zshrc as well.

Understanding zstyle

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEric BrottoView Question on Stackoverflow
Solution 1 - Command LineWernightView Answer on Stackoverflow
Solution 2 - Command LinecruizhView Answer on Stackoverflow
Solution 3 - Command Lineom-haView Answer on Stackoverflow