How do you reinstall nano on Mac OS X?
I accidentally overwrote my nano app with a unix binary version, and now nano doesnt work on my Mac OS (Maverick).
How do I restore nano or get it back?
I couldnt find it on homebrew and I don't know beans about compiling src files.
Nano error when trying to use git
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-rebase--interactive: line 225: /usr/bin/nano: cannot execute binary file
Could not execute editor
- Download the nano source (I recommend the tar.xz one) (nano-editor.org/download.php)
- Go to the folder it was downloaded to (By default it downloads to
~/Downloads
but if you changed the directory where files download then just go there). - Extract the nano source you downloaded.
- Open your terminal
- Type "cd " without the "" then drag and drop the folder you extracted and click enter.
- run "./configure" without the "".
- run "make" without the "".
- run "sudo make install" without the "".]
You have now successfully installed nano!
Update: The answer below is no longer accurate. As of Apr 4, 2017, the formulae were moved to homebrew/core. See https://github.com/Homebrew/homebrew-dupes/commits/master/README.md
The reason you can't find it in homebrew is because homebrew's main repo doesn't include programs that come with the OS. You have to add an additional repo:
brew tap homebrew/dupes
brew install nano
https://github.com/Homebrew/homebrew-dupes