14

I've migrated from an old MacBook Pro to a new one, using Apple's Migration assistant. Some home-brew formulas migrated with no problem, whereas others got broken at the library reference level. Reinstalling them does not help. E.g.:

$ weechat
dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
  Referenced from: /usr/local/bin/weechat
  Reason: image not found
Abort trap: 6

But

$ brew install weechat
Warning: weechat 2.2 is already installed and up-to-date
To reinstall 2.2, run `brew reinstall weechat`

Any ideas?

2
  • I'd recommend going with what the message says, i.e. reinstall the formula and that should take care of things. If I were you, I'd reinstall all the installed formula. Commented Aug 21, 2018 at 20:26
  • Thanks, @NimeshNeema. I tried to do that. The install process works well, but running weechat (and many other programs) ends with the same error message shown above. Commented Aug 22, 2018 at 1:39

4 Answers 4

15

Had the same problem, what I did was i run

brew list -1 > brew.txt # list out all installed packages
brew list -1 | xargs brew rm --force # remove all installed packages
brew install $(cat brew.txt | tr '\n' ' ') # install all previously installed packages

If everything went fine, remove the package list by:

rm brew.txt

You should probably check potential warnings as well.

2
  • Life saver solution Commented Sep 12, 2019 at 5:52
  • So... after a Migration Assistant install (at least for Catalina, my current system): one has to ** reinstall ALL Homebrew packages **? Like EVERY package? (That takes a looong time on my system.) What is the nature/reason for such a drastic requirement? (Have the Apple security folks maybe gone a bit overboard...??) Commented Aug 26, 2022 at 11:38
13

Yes doing the following will fix it

brew uninstall --force gettext
brew install gettext
2

Likely problem with libintl.8.dylib as in many other similar issues:

brew uninstall --force gettext
brew install gettext

locate libintl.8.dylib

if /gettext//libintl.*.dylib exists

brew link -f gettext

go to (depending on version)

cd /usr/local/Homebrew 
cd /usr/local/Library/Homebrew 

and execute (make sure you're in .../Homebrew directory)

git pull origin master
rm -fr ".git/rebase-apply"
brew update && brew upgrade

this last will took some time, but afterwards everything should work fine.

0

Workaround: Re-install the missing libraries, on a one-by-one basis.

For example:

$ weechat
dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
  Referenced from: /usr/local/bin/weechat
  Reason: image not found
Abort trap: 6

Means that gettext is missing. So:

$ brew install gettext

and try again. This time it will fail because of another missing library, but after all libraries have been installed, the application will run.

1
  • This is what I had to do. I did make the brew.txt file as mentioned by @maricn. But it kept failing on so many packages that I would remove those lines, save and try again. Eventually I got it working Commented Apr 2, 2019 at 18:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.