This guide helps you diagnose and resolve common issues when setting up development environments with the dev-machine-setup project.
All setup operations are logged to timestamped files in the current directory:
# macOS and Ubuntu
ls -la setup_*.txt
# Windows
ls setup_PowerShell_transcript.*.txtLook for error messages, failed commands, or timeout issues in these logs.
Run the setup with increased verbosity to get more detailed output:
# Single verbose flag
./setup.sh -v -e "your@email.com"
# Maximum verbosity (very detailed)
./setup.sh -vvv -e "your@email.com"Install only the prerequisites to isolate issues:
./setup.sh -pThis installs package managers and automation tools without running the full setup.
Ensure your system meets the minimum requirements:
- macOS: 10.15+ (Catalina or later)
- Windows: Windows 10/11 with PowerShell 5.1+
- Ubuntu: 20.04 LTS or later
- Debian: 13 (Trixie) or later
- Fedora: 39 or later
- All platforms: Internet connection and administrator privileges
Problem: Homebrew installation fails with permission errors
Error: Cannot write to /usr/local/CellarSolution:
# Fix Homebrew permissions
sudo chown -R $(whoami) /usr/local/Cellar /usr/local/bin /usr/local/shareProblem: Command Line Tools not installed
xcode-select: error: tool 'git' requires XcodeSolution:
# Install Xcode Command Line Tools
xcode-select --installProblem: Packages fail on Apple Silicon Macs
Error: Cannot install under Rosetta 2 in ARM default prefixSolution:
# In vars.yaml, enable Rosetta 2
install_rosetta: trueProblem: Some packages require Rosetta 2
Error: Package requires Intel architectureSolution: Install affected packages manually with Rosetta:
arch -x86_64 brew install package-nameProblem: Sudo password prompts interfere with automation
Solution: The setup script handles this automatically, but if you encounter issues:
# Clear any cached sudo credentials
sudo -k
# Run setup again
./setup.sh -e "your@email.com"Problem: Scripts cannot run due to execution policy
execution of scripts is disabled on this systemSolution:
# Allow scripts for current user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserProblem: Chocolatey fails to install
Exception calling "DownloadString" with "1" argument(s)Solution:
# Enable TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Install Chocolatey manually
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))Problem: Windows Defender blocks package installations
Solution:
- Add exclusion for Chocolatey directory:
C:\ProgramData\chocolatey - Temporarily disable real-time protection during setup
- Whitelist the setup script in Windows Defender
Problem: VS Code cannot connect to WSL
Solution:
# In WSL terminal
code --install-extension ms-vscode-remote.remote-wslProblem: Package lists are outdated
E: Unable to locate packageSolution:
sudo apt update && sudo apt upgrade -yProblem: Broken package dependencies
E: Unmet dependenciesSolution:
# Fix broken packages
sudo apt --fix-broken install
# Clean package cache
sudo apt autoremove && sudo apt autocleanProblem: Snap packages fail to install
error: cannot communicate with serverSolution:
# Restart snapd service
sudo systemctl restart snapd
# Check snap status
sudo systemctl status snapdProblem: Docker requires sudo
Solution:
# Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in, or restart the shell
newgrp dockerProblem: VS Code cannot write to directories
Solution:
# Fix VS Code directory permissions
sudo chown -R $USER:$USER ~/.vscodeProblem: Package lists are outdated
Error: Failed to synchronize cache for repoSolution:
sudo dnf makecache && sudo dnf upgrade -yProblem: Broken package dependencies
Error: package requires ..., but none of the providers can be installedSolution:
# Fix broken packages
sudo dnf distro-sync
# Clean package cache
sudo dnf autoremove && sudo dnf clean allProblem: Flatpak packages fail to install
error: Unable to load summary from remote flathubSolution:
# Re-add the Flathub remote
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Update Flatpak metadata
flatpak updateProblem: Docker requires sudo
Solution:
# Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in, or restart the shell
newgrp dockerProblem: VS Code cannot write to directories
Solution:
# Fix VS Code directory permissions
sudo chown -R $USER:$USER ~/.vscodeProblem: Package lists are outdated
E: Unable to locate packageSolution:
sudo apt update && sudo apt upgrade -yProblem: Broken package dependencies
E: Unmet dependenciesSolution:
# Fix broken packages
sudo apt --fix-broken install
# Clean package cache
sudo apt autoremove && sudo apt autocleanProblem: Flatpak packages fail to install
error: Unable to load summary from remote flathubSolution:
# Re-add the Flathub remote
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Update Flatpak metadata
flatpak updateProblem: Docker requires sudo
Solution:
# Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in, or restart the shell
newgrp dockerProblem: VS Code cannot write to directories
Solution:
# Fix VS Code directory permissions
sudo chown -R $USER:$USER ~/.vscodeProblem: Specific packages cannot be found in repositories
Solutions:
-
Check package name spelling:
# macOS brew search package-name # Windows choco search package-name # Ubuntu/Debian apt search package-name # Fedora dnf search package-name
-
Add required repositories:
# macOS: Add tap in vars.yaml homebrew_taps: - required/tap # Ubuntu: Add PPA via custom commands custom_commands_elevated: - add-apt-repository ppa:required/ppa
-
Use alternative package names:
# Try different variations homebrew_formulae: - package-name # - alternative-name # Try if first fails
Problem: Package conflicts with existing installations
Solutions:
-
Uninstall conflicting packages:
# macOS brew uninstall conflicting-package # Windows choco uninstall conflicting-package # Ubuntu sudo apt remove conflicting-package # Fedora sudo dnf remove conflicting-package
-
Use specific versions:
# macOS: Pin to specific version homebrew_formulae: - node@18 # Specific LTS version
Problem: Downloads fail or timeout
Solutions:
-
Check internet connection:
# Test connectivity ping google.com curl -I https://github.com -
Retry with different mirrors:
# macOS: Use different Homebrew mirror export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" # Ubuntu: Use different mirror sudo sed -i 's|archive.ubuntu.com|mirror.example.com|g' /etc/apt/sources.list
-
Increase timeout values:
# Set longer timeout for downloads export HOMEBREW_CURL_TIMEOUT=300
Problem: Extensions fail to install
Error: Extension 'publisher.extension' not foundSolutions:
-
Verify extension ID:
- Check VS Code marketplace for correct extension ID
- Ensure proper format:
publisher.extension-name
-
Install manually:
code --install-extension publisher.extension-name
-
Clear extension cache:
# Remove VS Code extensions directory rm -rf ~/.vscode/extensions
Problem: Extensions conflict with each other
Solution:
- Disable conflicting extensions temporarily
- Check extension documentation for known conflicts
- Use workspace-specific extension settings
Problem: Git authentication fails
Solutions:
-
Configure Git credentials:
# Set up credential helper (macOS) git config --global credential.helper osxkeychain # Set up credential helper (Windows) git config --global credential.helper manager # Set up credential helper (Ubuntu) git config --global credential.helper store
-
Generate SSH keys:
ssh-keygen -t ed25519 -C "your@email.com" ssh-add ~/.ssh/id_ed25519
Problem: Git user settings not configured properly
Solution:
# Verify current configuration
git config --global user.email
git config --global user.name
# Set manually if not configured
git config --global user.email "your@email.com"
git config --global user.name "Your Name"Problem: Setup takes extremely long time
Solutions:
-
Use parallel installation:
# macOS: Enable parallel downloads echo 'export HOMEBREW_PARALLEL=4' >> ~/.zshrc
-
Clean package caches:
# macOS brew cleanup # Windows choco cleancache # Ubuntu/Debian sudo apt clean && sudo apt autoremove # Fedora sudo dnf clean all && sudo dnf autoremove
-
Check available disk space:
df -h # Unix Get-WmiObject -Class Win32_LogicalDisk # Windows
Problem: System becomes unresponsive during installation
Solutions:
- Close unnecessary applications
- Install packages in smaller batches
- Increase virtual memory/swap space
Problem: Custom scripts fail to execute
Permission denied: ./custom_script.shSolution:
# Make script executable
chmod +x custom_script.shProblem: Script has wrong interpreter
bad interpreter: No such file or directorySolution:
# Fix shebang line at top of script
#!/bin/bash # For bash scripts
#!/bin/sh # For POSIX shell scriptsProblem: Environment variables not available in custom scripts
Solution:
# Source environment files in script
#!/bin/bash
source ~/.bashrc
source ~/.profile
# Your custom commands hereWhen reporting issues, collect this information:
-
System Information:
# macOS sw_vers && uname -m # Windows Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion # Ubuntu lsb_release -a && uname -m # Debian cat /etc/debian_version && uname -m # Fedora cat /etc/fedora-release && uname -m
-
Package Manager Versions:
# macOS brew --version # Windows choco --version # Ubuntu apt --version && snap --version # Debian apt --version && flatpak --version # Fedora dnf --version && flatpak --version
-
Log Files: Include relevant portions of setup log files
-
Configuration: Share your
vars.yamlconfiguration (remove sensitive information)
- GitHub Issues: Report bugs and feature requests
- Stack Overflow: Tag questions with
dev-machine-setup - Documentation: Check the complete documentation in the
docs/directory
If the setup has partially completed and left your system in an inconsistent state:
-
Review installed packages:
# macOS brew list # Windows choco list --local-only # Ubuntu/Debian apt list --installed # Fedora dnf list installed
-
Uninstall problematic packages:
# Use package manager uninstall commands brew uninstall package-name choco uninstall package-name sudo apt remove package-name # Ubuntu/Debian sudo dnf remove package-name
-
Reset package managers:
# macOS: Reinstall Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Start fresh: Re-run the setup with prerequisites only (
-pflag) to rebuild the foundation
This troubleshooting guide covers the most common issues encountered during setup. For additional help, check the platform-specific README files or open an issue in the project repository.