_# Homebrew Package Manager
_
Umfassende Homebrew-Befehle und Workflows für macOS und Linux-Paketverwaltung.
Installation und Inbetriebnahme
Homebrew installieren¶
```bash
Install Homebrew (macOS/Linux)¶
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Add to PATH (follow installer instructions)¶
echo 'eval "\((/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "\)(/opt/homebrew/bin/brew shellenv)" ```_
Basispaket Operationen¶
| Command | Description |
|---|---|
| INLINE_CODE_5 | Install package |
| INLINE_CODE_6 | Uninstall package |
| INLINE_CODE_7 | Upgrade all packages |
| INLINE_CODE_8 | Upgrade specific package |
| INLINE_CODE_9 | List installed packages |
| INLINE_CODE_10 | List outdated packages |
| _ | |
| Wählen Sie aus |
Search and Information¶
| Command | Description |
|---|---|
| INLINE_CODE_11 | Search for packages |
| INLINE_CODE_12 | Show package information |
| INLINE_CODE_13 | List installed packages with versions |
| INLINE_CODE_14 | Show package dependencies |
| INLINE_CODE_15 | Show packages that depend on this |
| INLINE_CODE_16 | Open package homepage |
Paket Details¶
| Command | Description |
|---|---|
| INLINE_CODE_17 | Show package description |
| INLINE_CODE_18 | Show package formula |
| INLINE_CODE_19 | Edit package formula |
| INLINE_CODE_20 | Show package commit history |
Ccask Management (GUI Applications)
Betrieb¶
| Command | Description |
|---|---|
| INLINE_CODE_21 | Install GUI application |
| INLINE_CODE_22 | Uninstall GUI application |
| INLINE_CODE_23 | List installed casks |
| INLINE_CODE_24 | Search for casks |
| INLINE_CODE_25 | Show cask information |
| INLINE_CODE_26 | Upgrade all casks |
Beliebte Casks_¶
| Cask | Description |
|---|---|
| INLINE_CODE_27 | VS Code editor |
| INLINE_CODE_28 | Chrome browser |
| INLINE_CODE_29 | Docker Desktop |
| INLINE_CODE_30 | Slack messaging |
| INLINE_CODE_31 | Zoom video conferencing |
| INLINE_CODE_32 | Spotify music |
Service Management
Service Operations¶
| Command | Description |
|---|---|
| INLINE_CODE_33 | List all services |
| INLINE_CODE_34 | Start service |
| INLINE_CODE_35 | Stop service |
| INLINE_CODE_36 | Restart service |
| INLINE_CODE_37 | Run service once |
Common Services¶
| Service | Description |
|---|---|
| INLINE_CODE_38 | PostgreSQL database |
| INLINE_CODE_39 | MySQL database |
| INLINE_CODE_40 | Redis cache |
| INLINE_CODE_41 | Nginx web server |
| INLINE_CODE_42 | MongoDB database |
• Tap Management (Drittanbieter-Repositories)
Tippen Sie auf Operationen¶
| Command | Description |
|---|---|
| INLINE_CODE_43 | List tapped repositories |
| INLINE_CODE_44 | Add tap |
| INLINE_CODE_45 | Remove tap |
| INLINE_CODE_46 | Show tap information |
| _ | |
| ### Beliebte Taps_ | |
| Tap | Description |
| ----- | ------------- |
| INLINE_CODE_47 | Fonts collection |
| INLINE_CODE_48 | Alternative app versions |
| INLINE_CODE_49 | Service management |
| INLINE_CODE_50 | MongoDB packages |
• Systemwartung
Reinigungsoperationen¶
| Command | Description |
|---|---|
| INLINE_CODE_51 | Remove old versions |
| INLINE_CODE_52 | Clean specific package |
| INLINE_CODE_53 | Remove all old downloads |
| INLINE_CODE_54 | Remove unused dependencies |
| _ | |
| ### Gesundheit und Diagnose | |
| Command | Description |
| --------- | ------------- |
| INLINE_CODE_55 | Check system for issues |
| INLINE_CODE_56 | Check for missing dependencies |
| INLINE_CODE_57 | Show Homebrew configuration |
| INLINE_CODE_58 | Show Homebrew version |
/ Fortgeschrittene Nutzung
Formula Development¶
| Command | Description |
|---|---|
| INLINE_CODE_59 | Create new formula |
| INLINE_CODE_60 | Edit formula |
| INLINE_CODE_61 | Build from source |
| INLINE_CODE_62 | Test formula |
Version Management¶
| Command | Description |
|---|---|
| INLINE_CODE_63 | Pin package version |
| INLINE_CODE_64 | Unpin package version |
| INLINE_CODE_65 | Switch to specific version |
| INLINE_CODE_66 | Show available versions |
| _ | |
| ### Bundle Management | |
| ```ruby | |
| # Brewfile example | |
| tap "homebrew/bundle" | |
| tap "homebrew/cask" | |
| tap "homebrew/core" |
brew "git" brew "node" brew "python" brew "docker"
cask "visual-studio-code" cask "google-chrome" cask "slack"
mas "Xcode", id: 497799835 ```_
| Command | Description |
|---|---|
| INLINE_CODE_67 | Install from Brewfile |
| INLINE_CODE_68 | Create Brewfile |
| INLINE_CODE_69 | Uninstall unlisted packages |
| INLINE_CODE_70 | Check Brewfile status |
Konfiguration
Environment Variables¶
| Variable | Description |
|---|---|
| INLINE_CODE_71 | Installation prefix |
| INLINE_CODE_72 | Package installation directory |
| INLINE_CODE_73 | Homebrew repository location |
| INLINE_CODE_74 | Download cache directory |
Konfiguration von Dateien¶
| File | Description |
|---|---|
| INLINE_CODE_75 | User configuration |
| INLINE_CODE_76 | Installation directory (Apple Silicon) |
| INLINE_CODE_77 | Installation directory (Intel) |
| INLINE_CODE_78 | Package bundle file |
Fehlerbehebung
Gemeinsame Themen¶
| Problem | Solution |
|---|---|
| Permission errors | INLINE_CODE_79 |
| Outdated Xcode tools | INLINE_CODE_80 |
| Broken symlinks | INLINE_CODE_81 |
| Formula conflicts | INLINE_CODE_82 |
| _ | |
| ### Reset and Reinstall_ | |
| Command | Description |
| --------- | ------------- |
| INLINE_CODE_83 | Force uninstall |
| INLINE_CODE_84 | Reinstall package |
| INLINE_CODE_85 | Force link |
| INLINE_CODE_86 | Remove dead symlinks |
Debugging¶
| Command | Description |
|---|---|
| INLINE_CODE_87 | Debug installation |
| INLINE_CODE_88 | Verbose installation |
| INLINE_CODE_89 | Create gist of logs |
 Leistungsoptimierung
Parallele Operationen¶
```bash
Enable parallel downloads¶
export HOMEBREW_PARALLEL=4
Disable analytics¶
export HOMEBREW_NO_ANALYTICS=1
Use faster GitHub API¶
export HOMEBREW_GITHUB_API_TOKEN=your_token ```_
Cache Management¶
| Command | Description |
|---|---|
| INLINE_CODE_90 | Keep 7 days of downloads |
| INLINE_CODE_91 | Check cache size |
| INLINE_CODE_92 | Clear all cache |
| _ | |
| Sicherheit |
Paketverifikation¶
| Command | Description |
|---|---|
| INLINE_CODE_93 | Audit package formula |
| INLINE_CODE_94 | Check formula style |
| INLINE_CODE_95 | Show detailed install process |
Sichere Praktiken¶
ANHANG Regular Updates: Homebrew und Pakete aktualisiert halten 2. Trusted Taps*: Nur vertrauenswürdige Drittangriffe hinzufügen 3. **Review Formulas*: Formeln vor der Installation überprüfen 4. **Backup: Pflege Brewfile für einfache Wiederherstellung 5. Leistungen: Vermeiden Sie das Laufen mit Sudo
Integration
Integration von Shell¶
```bash
Bash completion¶
if type brew &>/dev/null; then HOMEBREW_PREFIX="\((brew --prefix)" if [[ -r "\)\\{HOMEBREW_PREFIX\\}/etc/profile.d/bash_completion.sh" ]]; then source "$\\{HOMEBREW_PREFIX\\}/etc/profile.d/bash_completion.sh" fi fi
Zsh completion¶
if type brew &>/dev/null; then FPATH="\((brew --prefix)/share/zsh/site-functions:\)\\{FPATH\\}" autoload -Uz compinit compinit fi ```_
Development Workflow¶
```bash
Install development environment¶
brew install git node python ruby go rust brew install --cask visual-studio-code docker
Database setup¶
brew install postgresql redis brew services start postgresql brew services start redis
Create project¶
mkdir myproject && cd myproject npm init -y ```_
oder Best Practices
Paketmanagement¶
ANHANG Regular Maintenance: Laufen brew update && brew upgrade wöchentlich
2. Cleanup: Regelmäßige Reinigung von alten Versionen und Cache
3. Bundle Files: Brewfile für Teamkonsistenz verwenden
4. Pin Critical: Pin-Pakete, die bestimmte Versionen benötigen
5. Dokumentation: Dokumente benutzerdefinierte Taps und Konfigurationen
Entwicklungsumgebung¶
ANHANG Version Manager*: Verwenden Sie Versionsmanager für Sprachen (nvm, pyenv, rbenv) 2. **Virtual Environments*: Projektabhängigkeiten isolieren 3. **Service Management: Verwenden Sie Braudienstleistungen für Entwicklungsdatenbanken 4. Path Management: PATH sauber und organisiert halten 5. **Backup Strategie*: Regelmäßige Brewfile Dumps und Dotfile Backups
Performance¶
ANHANG Parallel Downloads*: Parallele Operationen aktivieren 2. **Cache Management: Regelmäßige Cache-Reinigung 3. ** Analytik**: Disable Analytics für schnellere Operationen 4. GitHub Token: Verwenden Sie GitHub-Token für API-Ratengrenzen 5. **SSD Optimierung*: Cache auf dem schnellsten Speicher speichern