########################################################################################################################################################################################################################################################## Copiar todos los comandos
########################################################################################################################################################################################################################################################## Generar PDF seleccionado/button
■/div titulada
Comandos completos y flujos de trabajo para macOS y gestión de paquetes Linux.
# 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
brew bundle
Install from Brewfile
brew bundle dump
Create Brewfile
brew bundle cleanup
Uninstall unlisted packages
brew bundle check
Check Brewfile status
Configuración
Medio ambiente
Variable
Description
HOMEBREW_PREFIX
Installation prefix
HOMEBREW_CELLAR
Package installation directory
HOMEBREW_REPOSITORY
Homebrew repository location
HOMEBREW_CACHE
Download cache directory
Archivos de configuración
File
Description
~/.homebrew/
User configuration
/opt/homebrew/
Installation directory (Apple Silicon)
/usr/local/
Installation directory (Intel)
Brewfile
Package bundle file
Solución de problemas
Cuestiones comunes
Problem
Solution
Permission errors
sudo chown -R $(whoami) /opt/homebrew
Outdated Xcode tools
xcode-select --install
Broken symlinks
brew doctor && brew cleanup
Formula conflicts
brew unlink package && brew link package
Reset and Reinstall
Command
Description
brew uninstall --force package_name
Force uninstall
brew reinstall package_name
Reinstall package
brew link --overwrite package_name
Force link
brew prune
Remove dead symlinks
Debugging
Command
Description
brew --debug install package
Debug installation
brew --verbose install package
Verbose installation
brew gist-logs package_name
Create gist of logs
Optimización del rendimiento
Operaciones paralelas
# 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
brew cleanup --prune=7
Keep 7 days of downloads
du -sh $(brew --cache)
Check cache size
rm -rf $(brew --cache)
Clear all cache
Seguridad
Verificación de paquetes
Command
Description
brew audit package_name
Audit package formula
brew style package_name
Check formula style
brew install --verbose package
Show detailed install process
Prácticas seguras
Regular Updates: Mantener Homebrew y paquetes actualizados
Trusted Taps: Sólo añadir grifos de confianza de terceros
Revise las Fórmulas: Compruebe las fórmulas antes de la instalación
Backup: Mantener Brewfile para una fácil restauración
Permisiones: Evite correr con sudo
Integración
Integración Shell
# 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