Skip to content

Brew has the current keg but still uses an older version

Source: Troubleshooting reference

Symptom: brew list --versions glib or another formula lists the current version, and brew outdated prints nothing, but opt/<formula>, bin/<tool>, or pkg-config still resolves an older keg. This can follow an interrupted or failed upgrade.

Inspect both the selected keg and the current keg’s receipt:

Terminal window
formula=glib
prefix=$(brew --prefix)
brew info --json=v2 "$formula" | jq '.formulae[0] | {linked_keg, installed}'
readlink -f "$prefix/opt/$formula"
ls "$prefix/Cellar/$formula"/*/INSTALL_RECEIPT.json

If the current keg has an install receipt, its direct executable works, and brew linkage --test "$formula" passes, preview and repair only the links:

Terminal window
brew link --overwrite --dry-run "$formula"
brew link --overwrite "$formula"

If its receipt is absent or brew info --json=v2 reports a null install time, the keg is incomplete. Do not force-link it; rebuild it:

Terminal window
HOMEBREW_NO_INSTALL_CLEANUP=1 brew reinstall --build-from-source "$formula"

This run found both forms: Fish 4.8.1 was complete but its bin/fish symlink still named 4.5.0, while GLib 2.88.3 lacked a receipt and had to be rebuilt.

OpenSSL 4 retries collide with an existing manpage

Section titled “OpenSSL 4 retries collide with an existing manpage”

On Linux, an interrupted OpenSSL 3-to-4 transition can leave a complete but unlinked openssl@4 keg while openssl@3 still owns the global links. A retry can install over leftover output and fail with Errno::EEXIST for share/man/man1/asn1parse.1ssl.gz: the formula tries to create a compressed manpage symlink that already exists. A long-prefix bottle warning explains the source build; it does not explain this file collision.

After all installs using the shared prefix have stopped, apply the receipt, direct-executable, and linkage checks above to openssl@4. If they pass, repair the transition without rebuilding the existing keg:

Terminal window
brew unlink openssl@3
brew link openssl@4
brew postinstall openssl@4
HOMEBREW_NO_INSTALL_CLEANUP=1 brew upgrade wget
brew linkage --test openssl@4 wget
wget --version
wget --spider --timeout=20 --tries=1 https://docs.brew.sh/

Unlinking preserves OpenSSL 3’s installed keg and opt/openssl@3 path, but source-built tools with an undeclared OpenSSL dependency may still need repair. Check the checksum execution described under checksum loader failures before proceeding to other installers. OpenSSL 4 should become globally linked, its post-install step should create the CA-certificate link, and wget should upgrade without rebuilding OpenSSL. If the keg fails the checks, use the source-reinstall path above instead; do not delete individual manpages or lock files.

On blackwell (Linux x86-64, shared NFS prefix, 2026-09-28), this repaired OpenSSL 4.0.2_1 and installed wget 1.25.0_2; Bundle check and the HTTPS request passed. The wget linkage audit still exited nonzero for indirect libunistring linkage: the Linux formula declares it transitively through dependencies, while this source build links it directly. It reported no missing libraries; this formula-declaration issue is separate from the OpenSSL installation failure and remains unresolved.