Macgnu
Transform the macOS CLI into a fresh GNU/Linux CLI experience by installing missing GNU programs, updating outdated GNU programs, replacing pre-installed BSD programs with their preferred GNU implementation.
Install / Use
/learn @shinokada/MacgnuREADME
Macgnu is a linuxify alternative.
If you want to linuxify your macOS core commands, but you may not want to install libressl, file-formula, git, openssh, perl, python, rsync, unzip, vim because you have already installed them. Then this is for you.
The macgnu is built on linuxify:
Transform the macOS CLI into a fresh GNU/Linux CLI experience by
- installing missing GNU programs
- updating outdated GNU programs
- replacing pre-installed BSD programs with their preferred GNU implementation
Macgnu :
- won't install
libressl, file-formula, git, openssh, perl, python, rsync, unzip, vim - won't ask if you want to change your shell to the latest bash.
Installing MacGNU with Awesome package manager
After installing Awesome package manager:
awesome install shinokada/macgnu
Install GNUs
macgnu install
Create ~/.macgnu.conf to customize which packages are installed (optional). See Configuration Guide for details.
After installation, create ~/.macgnu and copy .macgnu.
Add the following to your terminal configuration ~/.zshrc or ~/.bashrc
# ~/.zshrc
. ~/.macgnu
# ~/.bashrc
. ~/.macgnu
If you are using iTerm you may need to add the following to ~/.bash_profile:
. ~/.bashrc
Documentation
- Quick Start & Installation - Setup guide with examples
- New Features (v0.3.0+) - All new features and usage
- Configuration Guide - How to customize package selection
Available Commands
macgnu install # Install all GNU packages (respects config)
macgnu install pkg # Install a specific package
macgnu uninstall # Uninstall all GNU packages
macgnu status # Show installation status of all packages
macgnu info # Show info on GNU packages
macgnu -h # Show help message
macgnu -v # Show version
# Flags
--dry-run # Preview changes without applying them
--force # Force reinstall/upgrade packages
Configuration
Skip packages you don't want by creating ~/.macgnu.conf:
MACGNU_SKIP_PACKAGES="bash emacs nano"
See Configuration Guide for complete details.
Uninstalling GNUs
macgnu uninstall
Remove the following from ~/.zshrc and ~/.bashrc.
. ~/.macgnu
How to change to bash
You may want to change from ZSH to Bash and vice versa:
# from ZSH to Bash
$ which -a bash
/usr/local/bin/bash
/bin/bash
$ chsh -s /usr/local/bin/bash
Changing shell for shinokada.
Password for shinokada:
# Open a new tab or restart your terminal
$ which bash
/usr/local/bin/bash
# from Bash to ZSH
$ which -a zsh
/bin/zsh
$ chsh -s /bin/zsh
Changing shell for shinokada.
Password for shinokada:
# Open a new tab or restart your terminal
Testing
Run the comprehensive test suite:
# Full test suite
bash tests/run_tests.sh
# Unit tests only
bash tests/unit_tests.sh
See Testing Guide for details.
What's New in v0.3.0
- ✅ Configuration file support (
~/.macgnu.conf) - ✅ Status command to check installations
- ✅ Selective package installation
- ✅ Dry-run mode for preview
- ✅ Force reinstall/upgrade flag
- ✅ Progress feedback
- ✅ Comprehensive test suite
See New Features for full details.
For v0.2.4 Users
Upgrading from v0.2.4? See the Migration Guide for step-by-step instructions.
Resources
- 📖 Complete Implementation Guide - Technical details and implementation report
- Changelog - Detailed list of all changes
List of packages installed
GNU programs non-existing in macOS
- tree
- watch
- wget
- wdiff
- autoconf
GNU programs whose BSD counterpart is installed in macOS
- coreutils
- binutils
- diffutils
- ed
- findutils
- gawk
- gnu-indent
- gnu-sed
- gnu-tar
- gnu-which
- grep
- gzip
- screen
GNU programs existing in macOS which are outdated
- bash
- emacs
- gpatch
- less
- m4
- make
- nano
- bison
BSD programs existing in macOS which are outdated
- flex
License
MIT License
Copyright (c) 2021 Shinichi Okada
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
