Homebrew: fix codex stuck on old version (formula overrides cask)
Removes the outdated codex Homebrew formula (0.46.x) so the newly installed cask (0.47.x) becomes the active binary.
brew uninstall codex --formula
brew reinstall --cask codex
codex --version
Tags
brewcodexmacospackage-manager
Details
What this solves
When both the formula and cask are installed, the formula's older binary
often takes precedence in $PATH
, causing codex to say:
Update available! 0.46.0 → 0.47.0. Run brew upgrade codex ...
even though the cask at 0.47.0 is already installed.
Fix steps
- Remove the outdated formula:
brew uninstall codex --formula
- Reinstall (or relink) the cask cleanly:
brew reinstall --cask codex
- Confirm you're now on the latest:
codex --version
Expected output should now show 0.47.x instead of 0.46.x.
Safety Notes
- Non-destructive: removes only the formula, not your code or config.
- You keep the latest cask install and don’t lose any data.
Related Commands
Other useful commands you might find helpful
Temporarily Override DNS for a Domain (macOS)
Force your Mac to resolve a domain to a specific IP by modifying the /etc/hosts file
sudo nano /etc/hosts
ripgrep: search TypeScript files excluding common dirs
Search recursively for <Button in TS/TSX files while excluding node_modules, src/components/contact, and src/components/ui.
rg "<Button" -g "*.ts*" -g '!*./node_modules/**' -g '!src/components/contact/**' -g '!src/components/ui/**'
Related Articles
Blog posts that might provide additional context