Homebrew Paketmanager für Mac OS X: Unterschied zwischen den Versionen
| Zeile 20: | Zeile 20: | ||
brew install [Paketname] | brew install [Paketname] | ||
brew info [Paketname] # z.B. brew info phpmyadmin gibt infos zur Installation und Gebrauch | brew info [Paketname] # z.B. brew info phpmyadmin gibt infos zur Installation und Gebrauch | ||
| + | |||
| + | ==== Update / Upgrade ==== | ||
| + | Updating Homebrew: | ||
| + | brew update | ||
| + | Upgrade all individual packages and formula: | ||
| + | brew upgrade | ||
| + | If Problems reinstall | ||
| + | |||
| + | Avoid updating certain formula: | ||
| + | brew pin [name] | ||
| + | have it be updated again: | ||
| + | brew unpin [formula] | ||
== Übersicht von brew.sh == | == Übersicht von brew.sh == | ||
Version vom 24. Mai 2023, 06:04 Uhr
Einleitung
Der Homebrew Paketmanager ist recht praktisch wenn man viel mit Entwicklertools arbeiten möchte. NodeJS z.B.und anderes läßt sich damit schnell installieren und deinstallieren.
Links
https://brew.sh/index_de.html - Am Besten hier starten. Homebrew-Cask Mac - Apache MySql PHP Server mit Homebrew
Schnelleinstieg
Installieren
Am Besten über: den obigen Link. Dort gibt es ein immer aktuelles Starter Script. Alt:
- XCode Installieren
- Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Basics
brew doctor # Findet Probleme - ab und zu mal eingeben brew install [Paketname] brew info [Paketname] # z.B. brew info phpmyadmin gibt infos zur Installation und Gebrauch
Update / Upgrade
Updating Homebrew:
brew update
Upgrade all individual packages and formula:
brew upgrade
If Problems reinstall
Avoid updating certain formula:
brew pin [name]
have it be updated again:
brew unpin [formula]
Übersicht von brew.sh
Homebrew installiert die Sachen, die Du brauchst und die bei Apple nicht dabei sind.
$ brew install wget
Homebrew installiert Pakete in ihrem eigenen Verzeichnis und erstellt dann Symlinks der Dateien in /usr/local.
$ cd /usr/local $ find Cellar Cellar/wget/1.15 Cellar/wget/1.15/bin/wget Cellar/wget/1.15/share/man/man1/wget.1 $ ls -l bin bin/wget -> ../Cellar/wget/1.15/bin/wget
Homebrew installiert keine Dateien außerhalb seines Präfixes und Du kannst den Ort einer Homebrew-Installation frei wählen.
Eigene Homebrew-Pakete zu erzeugen, ist kinderleicht.
$ brew create http://foo.com/bar-1.0.tgz Created /usr/local/Library/Formula/bar.rb
Unter der Haube werden git und ruby verwendet. Modifikationen sind also schnell rückgängig gemacht und Upstream-Änderungen lassen sich leicht mergen.
$ brew edit wget # opens in $EDITOR!
Homebrew-Formeln sind einfache Ruby-Skripte:
require "formula"
class Wget < Formula
homepage "https://www.gnu.org/software/wget/"
url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"
sha1 "f3c925f19dfe5ed386daae4f339175c108c50574"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
end
Homebrew ergänzt OS X. Installiere Deine Gems mit gem und ihre Abhängigkeiten mit brew.
Installiere Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installationsnotizen
stephans-imac:~ stephan$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1 ==> The following directories will be made group writable: /usr/local/. /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 ==> The following directories will have their group set to admin: /usr/local/. /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 ... Warning: /usr/local/bin is not in your PATH. ==> Installation successful! ==> Next steps Run `brew doctor` before you install anything Run `brew help` to get started
PHP und Apache mit Homebrew
PHP
Mit Homebrew kann man PHP installieren
brew install php
Nach der Installation:
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.3/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
==> Summary
Homebrew Rechte für Multiuser
Jeder Admin soll Homebrew nutzen können:
#!/bin/sh # Configure homebrew permissions to allow multiple users on MAC OSX. # Any user from the admin group will be able to manage the homebrew and cask installation on the machine. # allow admins to manage homebrew's local install directory chgrp -R admin /usr/local chmod -R g+w /usr/local # allow admins to homebrew's local cache of formulae and source files chgrp -R admin /Library/Caches/Homebrew chmod -R g+w /Library/Caches/Homebrew # if you are using cask then allow admins to manager cask install too chgrp -R admin /opt/homebrew-cask chmod -R g+w /opt/homebrew-cask