Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew version of macports `port select --set`

One of the reasons I'm still using macports is that it is easy to switch between versions of things you download. For example, if I want to change my GCC version to 4.8 all I have to do is

sudo port set --select gcc mp-gcc48

No mucking around in environmental variables. I see that there are multiple versions of gcc to be got from homebrew, but is there an easy way to activate and deactivate versions of things? I didn't notice anything in the documentation.

like image 749
E. J. Winkleberry Avatar asked Oct 20 '22 22:10

E. J. Winkleberry


1 Answers

Option 1 is that you install multiple versioned packages in parallel. Then you'd call gcc-4.7 or gcc-4.8, etc.

Option 2 is to selectively brew link and brew unlink the package versions that you prefer to use. Note that an "unlinked" package is still installed and usable from /usr/local/opt/<package>/, it's just not in the default path.

Which one you use depends on how the individual packages are set up and how often you need to switch around. It's perhaps not quite as clear-cut as with MacPorts, but it works just fine.

like image 174
Peter Eisentraut Avatar answered Oct 24 '22 14:10

Peter Eisentraut