1er commit
De la docs au format Mkdocs
This commit is contained in:
457
docs/macos/homebrew/brew.md
Normal file
457
docs/macos/homebrew/brew.md
Normal file
@@ -0,0 +1,457 @@
|
||||
# Homebrew
|
||||
|
||||
|
||||
|
||||
**[:fa-link: https://docs.brew.sh](https://docs.brew.sh)**
|
||||
|
||||
[:fa-link: formulae.brew.sh](http://braumeister.org)
|
||||
|
||||
|
||||
|
||||
|
||||
### Update Homebrew et les formules:
|
||||
|
||||
```bash
|
||||
$ brew update
|
||||
```
|
||||
|
||||
### Chercher les M-à-J:
|
||||
|
||||
```bash
|
||||
$ brew outdated
|
||||
|
||||
# --verbose
|
||||
```
|
||||
|
||||
### Mettre tout à jour:
|
||||
|
||||
```bash
|
||||
$ brew upgrade
|
||||
|
||||
# --cleanup Met à jour et supprime les anciennes versions installées.
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Formules:
|
||||
|
||||
#### Mettre à jour une formule:
|
||||
|
||||
```bash
|
||||
$ brew upgrade <formula>
|
||||
|
||||
# --cleanup Met à jour et supprime les anciennes versions installées.
|
||||
```
|
||||
|
||||
#### Installer une formule:
|
||||
|
||||
```bash
|
||||
$ brew install <formula>
|
||||
|
||||
$ brew install --verbose --debug <formula>
|
||||
|
||||
# --build-from-source Compile la formule depuis la source même si une bottle est disponible. Les dépendances sont installées depuis les bottles.
|
||||
```
|
||||
|
||||
#### Installer une formule d’ailleurs la branche:
|
||||
|
||||
```bash
|
||||
$ brew install https://raw.github.com/user/repo/branch/formula.rb
|
||||
```
|
||||
|
||||
#### Reinstaller une formule depuis les sources:
|
||||
|
||||
```bash
|
||||
$ brew reinstall -s <formula>
|
||||
```
|
||||
|
||||
#### Desinstaller une formule:
|
||||
|
||||
```bash
|
||||
$ brew uninstall <formula>
|
||||
|
||||
# --force toutes les versions de la formule seront effacées
|
||||
# --ignore-dependencies desinstallera même si des dépendances restent installées
|
||||
```
|
||||
|
||||
#### Desinstaller les anciennes versions d’une formule:
|
||||
|
||||
```bash
|
||||
$ brew cleanup <formula>
|
||||
|
||||
# Supprime toutes les anciennes dans la Cellar et dans le Cache.
|
||||
|
||||
# --dry-run (ou -n) montre ce qui va être supprimer mais n'enlève rien.
|
||||
# --prune=days supprime les fichiers du Cache plus vieux que <days> jours.
|
||||
```
|
||||
|
||||
#### Desinstaller toutes les anciennes versions:
|
||||
|
||||
```bash
|
||||
$ brew cleanup
|
||||
|
||||
# (-n ou --dry-run) voir tout ce qui sera désinstaller
|
||||
```
|
||||
|
||||
#### Empecher la m-à-j d’un package:
|
||||
|
||||
```bash
|
||||
$ brew pin <formula>
|
||||
```
|
||||
```bash
|
||||
bruno@SilverBook:/usr/local/Cellar/terminal-notifier/1.8.0$ brew pin terminal-notifier
|
||||
```
|
||||
|
||||
#### Re-permettre la m-à-j:
|
||||
|
||||
```bash
|
||||
$ brew unpin <formula>
|
||||
```
|
||||
|
||||
#### Liste des formules installées:
|
||||
|
||||
```bash
|
||||
$ brew list
|
||||
|
||||
# --versions affiche la verion en plus.
|
||||
# --pinned affiche les formules pinned
|
||||
```
|
||||
|
||||
#### Afficher des infos sur une formule installée:
|
||||
|
||||
```bash
|
||||
$ brew info <formula>
|
||||
```
|
||||
```bash
|
||||
$ brew info terminal-notifier
|
||||
|
||||
terminal-notifier: stable 1.8.0 (bottled), HEAD
|
||||
|
||||
Send macOS User Notifications from the command-line
|
||||
|
||||
https://github.com/julienXX/terminal-notifier
|
||||
|
||||
/usr/local/Cellar/terminal-notifier/1.7.1 (14 files, 2MB)
|
||||
|
||||
Poured from bottle on 2016-10-19 at 07:24:46
|
||||
|
||||
/usr/local/Cellar/terminal-notifier/1.8.0 (5 files, 99.8KB) *
|
||||
|
||||
Poured from bottle on 2017-08-12 at 20:20:48
|
||||
|
||||
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/terminal-notifier.rb
|
||||
|
||||
==> Requirements
|
||||
|
||||
Build: xcode ✔
|
||||
|
||||
Required: macOS >= 10.8 ✔
|
||||
```
|
||||
|
||||
#### Description d'une formule:
|
||||
|
||||
```bash
|
||||
$ brew desc <formula>
|
||||
```
|
||||
|
||||
```bash
|
||||
$ brew desc httpd
|
||||
httpd: Apache HTTP server
|
||||
```
|
||||
|
||||
#### Afficher les options d'une formule:
|
||||
|
||||
```bash
|
||||
$ brew options <formula>
|
||||
```
|
||||
|
||||
```bash
|
||||
$ brew options php72
|
||||
--with-argon2
|
||||
Include libargon2 password hashing support
|
||||
--with-cgi
|
||||
Enable building of the CGI executable (implies --without-fpm)
|
||||
--with-debug
|
||||
Compile with debugging symbols
|
||||
|
||||
# --compact sur une seule ligne
|
||||
```
|
||||
|
||||
#### Chercher une formule (avec description):
|
||||
|
||||
```bash
|
||||
$ brew search --desc <formula>
|
||||
```
|
||||
|
||||
```bash
|
||||
$ brew search --desc pdf
|
||||
|
||||
briss: Crop PDF files
|
||||
|
||||
diff-pdf: Visually compare two PDF files
|
||||
```
|
||||
|
||||
#### Activer une autre version:
|
||||
|
||||
```bash
|
||||
$ brew switch <formula>
|
||||
```
|
||||
```bash
|
||||
bruno@SilverBook:/usr/local/Cellar/terminal-notifier/1.8.0$ brew switch terminal-notifier 1.7.1
|
||||
|
||||
Cleaning /usr/local/Cellar/terminal-notifier/1.7.1
|
||||
|
||||
Cleaning /usr/local/Cellar/terminal-notifier/1.8.0
|
||||
|
||||
1 links created for /usr/local/Cellar/terminal-notifier/1.7.1
|
||||
```
|
||||
|
||||
#### Configurer (arguments) une formule:
|
||||
|
||||
```bash
|
||||
$ brew edit <formula>
|
||||
```
|
||||
|
||||
#### Afficher la homepage de Homebrew:
|
||||
|
||||
```bash
|
||||
$ brew home
|
||||
```
|
||||
|
||||
#### Afficher la homepage de la formule:
|
||||
|
||||
```bash
|
||||
$ brew home <formula>
|
||||
```
|
||||
|
||||
#### Log:
|
||||
|
||||
```bash
|
||||
$ brew log <formula>
|
||||
```
|
||||
|
||||
#### « keg-only »
|
||||
|
||||
La formule est installée dans Cellar. Elle n’est pas linkée dans /usr/local
|
||||
|
||||
<u>Pour la linker:</u>
|
||||
|
||||
```bash
|
||||
$ brew link
|
||||
```
|
||||
|
||||
#### Changer de version de PHP:
|
||||
|
||||
```bash
|
||||
$ brew unlink php54 && brew link php53
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
### Dépendances:
|
||||
|
||||
#### Voir les dépendances:
|
||||
|
||||
```bash
|
||||
$ brew deps <formula>
|
||||
```
|
||||
|
||||
```bash
|
||||
$ brew deps httpd
|
||||
apr
|
||||
apr-util
|
||||
boost
|
||||
c-ares
|
||||
jansson
|
||||
jemalloc
|
||||
libev
|
||||
libevent
|
||||
nghttp2
|
||||
openssl
|
||||
pcre
|
||||
|
||||
# --tree Présentation comme arbre
|
||||
```
|
||||
|
||||
#### Montrer les formules installées qui ne sont pas des dépendances d'autres formules installées:
|
||||
|
||||
```bash
|
||||
$ brew leaves
|
||||
```
|
||||
|
||||
#### Montrer les dépendances manquantes:
|
||||
|
||||
```bash
|
||||
$ brew missing
|
||||
$ brew missing <formula>
|
||||
```
|
||||
|
||||
#### Dépendances inverses:
|
||||
|
||||
```bash
|
||||
$ brew uses x264 --installed
|
||||
ffmpeg
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Outils:
|
||||
|
||||
#### Vérifier le système:
|
||||
|
||||
```bash
|
||||
$ brew doctor
|
||||
```
|
||||
|
||||
#### Prune (supprimer les liens symboliques morts):
|
||||
|
||||
```bash
|
||||
$ brew prune
|
||||
|
||||
# --dry-run
|
||||
```
|
||||
|
||||
#### Où va tout ce que télécharge Homebrew (cache):
|
||||
|
||||
```bash
|
||||
$ brew --cache
|
||||
|
||||
/Users/bruno/Library/Caches/Homebrew
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cd /Users/bruno/Library/Caches/Homebrew
|
||||
total 2616544
|
||||
drwxr-xr-x 92 bruno staff 2944 17 jan 17:19 .
|
||||
drwx------+ 194 bruno staff 6208 18 jan 18:57 ..
|
||||
drwxr-xr-x 11 bruno staff 352 18 jan 18:54 Cask
|
||||
-rw-r--r-- 1 bruno staff 400053 28 oct 08:20 apr-1.6.3.high_sierra.bottle.tar.gz
|
||||
-rw-r--r-- 1 bruno staff 242481 3 nov 02:01 apr-util-1.6.1_1.high_sierra.bottle.tar.gz
|
||||
-rw-r--r-- 1 bruno staff 88679443 19 déc 10:23 boost-1.66.0.high_sierra.bottle.tar.gz
|
||||
-rw-r--r-- 1 bruno staff 3434 16 déc 20:15 brew-pip-0.4.1.tar.gz
|
||||
-rw-r--r-- 1 bruno staff 12310915 21 nov 13:01 cmake-3.10.0.high_sierra.bottle.tar.gz
|
||||
```
|
||||
|
||||
#### Affiche le chemin de Cellar:
|
||||
|
||||
```bash
|
||||
$ brew --Cellar
|
||||
/usr/local/Cellar
|
||||
|
||||
$ brew --Cellar httpd
|
||||
/usr/local/Cellar/httpd
|
||||
```
|
||||
|
||||
#### Sauvegarder sa configuration Homebrew:
|
||||
|
||||
Liste des packages, taps et casks installés:
|
||||
|
||||
```bash
|
||||
$ brew tap Homebrew/bundle
|
||||
$ brew bundle dump
|
||||
```
|
||||
|
||||
Ceci crée un fichier <u>Brewfile</u> que l'on peut éditer.
|
||||
|
||||
```bash
|
||||
tap 'homebrew/php'
|
||||
brew 'homebrew/php/php71', args: ['with-imap']
|
||||
brew 'shpotify'
|
||||
cask 'spotify'
|
||||
```
|
||||
|
||||
#### Restaurer sa configuration:
|
||||
|
||||
```bash
|
||||
# Se positionner dans le répertoire contenant le fichier Brewfile
|
||||
|
||||
$ brew bundle
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Services:
|
||||
|
||||
#### Liste des services gérés par brew services:
|
||||
|
||||
```bash
|
||||
bruno@SilverBook:~$ brew services list
|
||||
|
||||
Name Status User Plist
|
||||
|
||||
mariadb started bruno /Users/bruno/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
|
||||
|
||||
php71 started bruno /Users/bruno/Library/LaunchAgents/homebrew.mxcl.php71.plist
|
||||
|
||||
httpd started root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
|
||||
```
|
||||
|
||||
#### Lancer au démarrage:
|
||||
|
||||
```bash
|
||||
$ brew services start mysql
|
||||
```
|
||||
|
||||
#### Démarrer (pas au boot):
|
||||
|
||||
```bash
|
||||
$ brew services run mysql
|
||||
```
|
||||
|
||||
#### Arrêter le service:
|
||||
|
||||
```bash
|
||||
$ brew services stop mysql
|
||||
```
|
||||
|
||||
#### Redémarrer le service:
|
||||
|
||||
```bash
|
||||
$ brew services restart mysql
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Taps (third-party repositories):
|
||||
|
||||
[:fa-link: brew tap](https://docs.brew.sh/Taps.html) rajoute des repositories à **brew**
|
||||
|
||||
#### Liste les repos tapped:
|
||||
|
||||
```bash
|
||||
$ brew tap
|
||||
caskroom/cask
|
||||
homebrew/apache
|
||||
homebrew/core
|
||||
homebrew/dupes
|
||||
homebrew/php
|
||||
homebrew/services
|
||||
homebrew/versions
|
||||
tideways/profiler
|
||||
vapor/tap
|
||||
```
|
||||
|
||||
<u>Les tap sont situés là:</u>
|
||||
|
||||
```bash
|
||||
bruno@silverbook:/usr/local/Homebrew/Library/Taps$ ls
|
||||
caskroom homebrew tideways vapor
|
||||
```
|
||||
|
||||
#### Ajouter un repo:
|
||||
|
||||
```bash
|
||||
$ brew tap <tapname>
|
||||
```
|
||||
|
||||
#### Supprimer un repo:
|
||||
|
||||
```bash
|
||||
$ brew untap <tapname>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Cask:
|
||||
|
||||
### [:fa-link: Homebrew-Cask](brew-cask.md)
|
||||
Reference in New Issue
Block a user