Man kann Homebrew und MacPorts nicht „einfach so“ parallel installieren und in den PATH aufnehmen.
Da ich MacPorts schon seit jahren benutze, aber auch gerne Homebrew verwenden würde, habe ich folgendes getan:
- (Schon vor Jahren): MacPorts installieren.
- Aus
~/.profiledie von Macports eingefügten Zeilen entfernen:export PATH=/opt/local/bin:/opt/local/sbin:$PATH - Ebenso in
~/.bash_profile - Homebrew installieren.
- Datei
~/bin/macportsanlegen und anschließen ausführbar machen (chmod +x ~/bin/macports):
#!/bin/bash
## Wrap Macports command (any executables installed by Macports).
if [ "$#" -le 0 ]; then
echo "Usage: $0 command [arg1, arg2, ...]" >&2
exit 1
fi
if [[ -z $MACPORTS_PREFIX ]]; then
MACPORTS_PREFIX='/opt/local'
fi
export PATH="$MACPORTS_PREFIX/bin:$MACPORTS_PREFIX/sbin:$PATH"
export CPATH="$MACPORTS_PREFIX/include:$CPATH"
command=$1
shift
exec $command $*
- Anschließend
portsselber und vonportsinstallierte Kommandos so ausführen:
macports port install wget
macports wget http://www.heise.de/
- Hinweis aus der Quelle (den ich aber noch nicht nutzen musste): When using Homebrew to install packages, one noticeable thing is that sometimes /opt/local may interference the build of the packages. In this case, you might want to try to run brew install –env=std package_name and brew install –env=super package_name to see whether the build works, or you even need to rename /opt/local temporarily.
(Quelle: https://www.topbug.net/blog/2013/10/23/use-both-homebrew-and-macports-on-your-os-x/)
One thought on “Mac: Homebrew parallel zu MacPorts installieren”