Trouble Installing Homebrew on Mac - macos

I am having trouble installing Homebrew on a mac. I am running Mac OS X 10.8.4.
When I try to install it through
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Or:
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
I get:
\-bash: curl: command not found
-bash: ruby: command not found
I have also tried:
cd /usr/local/bin
mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
And got:
-bash: mkdir: command not found
What do you think may be wrong>

Related

Brew stops working after terminal session is closed

I have installed Brew in MACOS Monterey with the following commands.
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
eval "$(homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
I have tested it after the install, and it works, however closing the terminal session and opening it again causes terminal to say that the command brew is not found after running it. I can still see the homebrew directory, so Im guessing its in the wrong place for terminal to run it.
The only supported method to install brew is found on brew.sh:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Ok I was able to fix the issue by adding the PATH to the .bash_profile file.

zsh: command not found: mkfs on macOS

Hi i entered it in terminal macOS
dd if=/dev/zero of=img.1440 bs=1k count=1440
mkfs img.1440
And got this error
zsh: command not found: mkfs
mkfs is a Linux command, but if you have Homebrew installed, you can install e2fsprogs:
brew install e2fsprogs
Then run mkfs.ext3:
$(brew --prefix e2fsprogs)/sbin/mkfs.ext3 img.1440

Install homebrew using Makefile

I'm trying to install Homebrew using a Makefile, the contents of the Makefile is this:
.PHONY: install
install:
# Install homebrew
/usr/bin/ruby -e $(shell curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
However this just prints the entire contents of the script, but it does not execute anything. I got as far as googling for this issue and seeing that the characters $, (, ) have a special meaning in a Makefile, however I could not find any solution.
try just piping output from curl to ruby like this:
.PHONY: install
install:
# Install homebrew
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install | ruby
If you encounter the following warning:
Warning: The Ruby Homebrew install is now deprecated and has been rewritten in Bash.
Please migrate to the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
You can modify #igagis answer as such
.PHONY:install
install:
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | bash
I was running into needing sudo, then sudo telling me not to run as root so the command i used was:
sudo true
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | sudo -u $$USER bash
Notes:
I use sudo true to run sudo and do nothing. that way the user can input their password. running sudo make from the terminal caused the $USER to be root. if you remove the sudo true line, then if sudo has not been run yet, the sudo access check will fail and not let you insert a password when running the curl line
the two $ makes the makefile write a literal $

Installing Homebrew on Macbook running El Capitan

When I run this command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I get the following error:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md git include lib libexec Library LICENSE.txt n share var .git .github .gitignore
However, when I run brew doctor, this error is thrown:
bash: brew: command not found
And when I try to un-install Homebrew using this script:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
my command prompt responds with:
Failed to locate Homebrew!
Please help.
First delete all homebrew files manually. Then reinstall Homebrew from scratch. Prefix sudo at your own discretion:
# packages
rm -rf /usr/local/Cellar
# executable
rm /usr/local/bin/brew
# meta
rm -rf /usr/local/.git
rm /usr/local/.github
rm /usr/local/.gitignore
rm /usr/local/.travis.yml
rm /usr/local/.yardopts
rm /usr/local/CODEOFCONDUCT.md
rm /usr/local/LICENSE.txt
rm /usr/local/README.md
# home
rm ~/.rvm/bin/brew
rm ~/.homebrew
rm -rf ~/Library/Caches/Homebrew
rm -rf ~/Library/Logs/Homebrew
# other
rm -rf /Library/Caches/Homebrew
# find more files to delete; delete Homebrew files only!
find / -name "*brew*"
IMPORTANT: because of permission errors upon reinstall, you may have to do one of the following steps before reinstallation; see: https://github.com/Homebrew/legacy-homebrew/issues/15138
# via: https://github.com/Homebrew/legacy-homebrew/issues/15138#issuecomment-19258042
cd /usr/local
sudo mv -v Library Library.old
# --OR--
# via: https://github.com/Homebrew/legacy-homebrew/issues/15138#issuecomment-33338868
# see: http://linuxcommand.org/man_pages/chmod1.html
cd /usr/local
chmod -R 775 Library
Reinstall Homebrew; see: http://brew.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
There is a problem related to the latest version of XCode and Homebrew. Open a terminal and run:
rm -rf /usr/local/Cellar /usr/local/.git
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you get permission denied error use sudo. Directory /usr/local/Cellar/ is completely removed when uninstalling Homebrew, so it is safe to remove it.

Installing brew with OS X issue

When I try to install brew with the command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I get the following error
/Users/nouveau/.rbenv/shims/ruby: ligne21: /usr/local/Cellar/rbenv/0.4.0/libexec/rbenv: No such file or directory
How can I solve this?
Your rbenv installation seems to be broken. Just remove it:
cd
rm -rf rbenv
rm -rf /usr/local/Cellar
exit # close terminal
Then repeat homebrew installation (with your system Ruby):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Resources