Homebrew is not getting installed - homebrew

I moved from Windows to macOS a few days ago. I want to install homebrew. I used the following command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
but I am getting an error of permission denied.
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
/usr/local/Homebrew/.git/branches/: Permission denied
Failed during: git init -q
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
error: could not lock config file .git/config: Permission denied
Failed during: git config --replace-all homebrew.analyticsmessage true
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
I checked many other Stackoverflow answers and followed articles online but I am not getting any solution.
comptag:~ username$ brew install curl
-bash: /usr/local/bin/brew: No such file or directory
Please suggest me some solutions.

Use the official command given on the Homebrew website:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Related

Unable to install Homebrew on BigSur "Login denied"

I am trying to install homebrew on MacOS BigSur, using the command foudn on the homebrew web page:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
But when I do I get this error message, which I suspect has something to so with performing an unshallow clone of the repo. I don't really know how to get past it though.
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': Login denied
Failed during: git fetch --force origin

Errors when trying to install jenkins using Homebrew

screenshot of actual error message
I have tried all the alternative ways to install jenkins on my macbook air but with no lack. I will appreciate anyone with the current solution to this.
This is the error message I get after running brew install jenkins:
Error: No similarly named formulae found.
Error: No available formula or cask with the name "jenkins".
It was migrated from homebrew/cask to homebrew/core.
I also get a "fata" message
fatal: Needed a single revision
I am very knew to Jenkins and trying to learn usage.
enter image description here
brew doctor
then
Homebrew/homebrew-core was not tapped properly! Run:
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
then
brew install jenkins-lts
Run this command in terminal:
rm -fr $(brew --repo homebrew/core)
Then try:
brew install jenkins
It works
Have a look on this page : https://www.jenkins.io/download/lts/macos/
You must use brew install jenkins-lts to install jenkins.

No available formula or cask with the name "portaudio"

I have installed homebrew.
I was trying install PyAudio but to install PyAudio I had to install portaudio .
I wrote " brew install portaudio " in terminal and I got many errors.
Error: No available formula or cask with the name "portaudio".
fatal: Needed a single revision
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "portaudio".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
After this I tried " pip install pyaudio " and got more errors.
enter image description here
i got those exact errors and solved it after following these steps:
uninstall homebrew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
re-install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install portaudio
pip install pyaudio

Can't re-install homebrew

I'm having a problem re-installing homebrew. I am running Mavericks
It started with me trying to install express.js. Homebrew had been installed on my mac for quite some time, never had any trouble with it. I used sudo npm install -g express, but when I ran express --version, I got command not found. Eventually, I found a possible solution online, and just tried to reinstall npm with brew remove npm and brew install npm. Again, I ran into errors (Unfortunately, I didn't save the exact errors) I used brew doctor to try and figure it out, looked up a ton of tutorials and mucked around with homebrew, and I guess I broke something.
Now, I figure I should just try and reinstall homebrew.
I run the install command for homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It returns this message:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
So, I run
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
This returns:
-bash: brew: command not found
I try running the install command again, and this time, it doesn't tell me homebrew is already installed.
So again, I run the install command for homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And now I get this:
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
remote: Counting objects: 136, done.
remote: Total 136 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (136/136), 10.37 MiB | 1.53 MiB/s, done.
Resolving deltas: 100% (44/44), done.
From https://github.com/Onomanatee/portfolio_Yuri_Legiest
* [new branch] master -> origin/master
HEAD is now at c253261 Commit4
==> Installation successful!
==> Next steps
Run brew doctor before you install anything
Run brew help to get started
Running brew doctor or brew help , however, results in
-bash: brew: command not found
I really don't know how to fix this. And why is the brew installer referring to a repository I used as a test for a little web project? (right above Installation succesful!)

brew install nginx fails to link

I am attempting to install nginx using the brew package manager, but it fails to link. How can I fix this?
roc-web5537:Downloads cmuench$ brew install nginx
Warning: Your Xcode (4.3.3) is outdated
Please install Xcode 4.5.
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.bz2
Already downloaded: /Library/Caches/Homebrew/pcre-8.31.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/pcre/8.31 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2
==> make test
==> make install
Warning: Could not link pcre. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link pcre'
==> Summary
/usr/local/Cellar/pcre/8.31: 130 files, 3.2M, built in 18 seconds
==> Installing nginx
==> Downloading http://nginx.org/download/nginx-1.2.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/nginx-1.2.4.tar.gz
==> Patching
patching file conf/nginx.conf
==> ./configure --prefix=/usr/local/Cellar/nginx/1.2.4 --with-http_ssl_module --with-pcre --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf-path=/usr/loca
==> make
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.2.4/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Warning: Could not link nginx. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link nginx'
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/nginx/1.2.4: 9 files, 952K, built in 9 seconds
I had this issue a few days ago with installation of Yeoman. It seems that some of the folders in /usr/local might not be owned by you and that can cause issues. In my case I had a couple of folders in /usr/local/ like that.
Go to /usr/local
cd /usr/local
Check who owns the folders
ls -l
Do the following for folders not owned by you (replacing sub-foldername with sub folders name obviously):
sudo chown $(whoami) /usr/local/<sub-foldername>
and then call
brew link pcre
It should link successfully.
Hope this helps.
This can sometimes happen if there area already files (or symlinks) with the same name. To force a link, you can use brew link -f pcre. If you want to see whether there are any files preventing the link, you can use brew link --dry-run pcre.
If there are no files listed by brew link --dry-run pcre, then it is likely that jwwishart's answer is the correct one.
I had to remove manually and reinstall pcre and openssl then nginx will work:
brew remove pcre
brew remove openssl
brew install pcre
brew install openssl
nginx
Was getting
erma4inapower#MacBook-Pro-Dmitrij  ~  brew services start php
Error: Permission denied # rb_sysopen - /Users/erma4inapower/Library/LaunchAgents/homebrew.mxcl.php.plist
Ended up:
sudo chown -R $(whoami) /Users/erma4inapower/Library/LaunchAgents/
I had the same issue and was causing problems while other services using brew.
how to fix run
brew doctor
remove all files which are causing the issue. might have to do
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
if warning comes up
make sure you are in master branch by
git -C $(brew --repo homebrew/core)
checkout Important is the brew doctor command which help me fix the issue.

Resources