A modern, unified macOS package manager installer for MacPorts
# Download and run - that's it!
sudo ./macportsAssistant.shThe script automatically detects your system and does the right thing:
- 🆕 Fresh installation if MacPorts isn't installed
- ⬆️ Smart upgrade if you have an existing macportsAssistant installation
- 🔄 Update only with
--update-onlyflag
- ✅ Zero Configuration - Automatically detects what needs to be done
- 🎯 Intelligent - Knows the difference between install, upgrade, and update
- 🛡️ Safe - Backs up your ports before upgrades
- 🎨 Modern - Colorized output with clear progress indicators
- 🔧 Robust - Comprehensive error handling and recovery
- 📱 Compatible - Supports macOS 10.12 Sierra through macOS 15 Sequoia
- macOS 10.12 Sierra or later
- Administrator privileges (
sudo) - Internet connection
- Xcode Command Line Tools (installed automatically if needed)
# Let the script decide what to do
sudo ./macportsAssistant.sh# Show help
sudo ./macportsAssistant.sh --help
# Force reinstallation
sudo ./macportsAssistant.sh --force
# Only update existing installation
sudo ./macportsAssistant.sh --update-only
# Show version
sudo ./macportsAssistant.sh --versionAfter installation, keep MacPorts updated with:
sudo ~/bin/macports_updater.sh-
🔍 Detection Phase
- Checks if MacPorts is installed
- Determines if it was installed by macportsAssistant
- Identifies your macOS version
-
⚙️ Setup Phase
- Creates
~/bin/MacPortsworking directory - Installs/updates Xcode Command Line Tools
- Downloads appropriate MacPorts version for your macOS
- Creates
-
📦 Installation/Upgrade Phase
- New Install: Fresh MacPorts installation
- Upgrade: Backs up ports → Reinstalls MacPorts → Restores ports
- Update: Updates MacPorts and all installed ports
-
🔧 Maintenance Phase
- Creates updater script in
~/bin/ - Sets up proper permissions and ownership
- Adds directories to PATH
- Creates updater script in
macportsAssistant/
├── macportsAssistant.sh # ← Main script (start here!)
├── macports_updater.sh # Modern updater template
├── README.md # This file
├── CHANGELOG.md # Version history
├── VERSION # Current version info
├── legacy/ # Legacy scripts for compatibility
│ ├── README.md # Legacy documentation
│ ├── macports_assistant_install.sh
│ ├── macports_assistant_upgrade.sh
│ └── macports_updater_legacy.sh
└── [documentation files...]
The original individual scripts are preserved in the legacy/ directory for backward compatibility. New users should use the unified macportsAssistant.sh script.
Permission Errors
# Ensure you're using sudo
sudo ./macportsAssistant.shDownload Failures
- Check internet connection
- Try again (temporary network issues)
- Check if GitHub is accessible
Xcode Issues
# Manually install if automatic installation fails
xcode-select --installPort Restoration Issues
- Backup files are saved in
~/bin/MacPorts/ - Manually restore using:
sudo port install $(cat ~/bin/MacPorts/myports.txt)
- Current Version: 3.0.0 (Unified script) / 2.2.2 (Legacy scripts)
- Supported macOS: 10.12 Sierra through 15 Sequoia
- MacPorts Versions: Automatically selects latest compatible version
See CHANGELOG.md for detailed version history.
The project follows modern development practices:
- Error Handling:
set -euo pipefailfor robust bash scripting - Code Style:
.editorconfigfor consistent formatting - Version Control: Proper
.gitignoreand.gitattributes - Documentation: Comprehensive changelog and docs
See CONTRIBUTING for contribution guidelines.
If you encounter issues:
- Check CHANGELOG.md for known issues
- Verify system requirements
- Try
--forcefor problematic installations - Report bugs following BUGS guidelines
GNU General Public License v3.0 - see COPYING for details.
Hoyt Harness • Positronikal • Email • 2023-2024