You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

I see homebrew when I open terminal

Recently I deleted Homebrew and when I open the terminal I started seeing this: /Users/abdullahmuhammad/.zprofile:1: no such file or directory: /opt/homebrew/bin/brew

i have this problem on my MacBook Air M1



Anyone know the solution to fix this problem?

MacBook Air

Posted on Mar 12, 2021 2:47 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 12, 2021 2:56 PM

It's not likely a critical problem. When you previously installed Homebrew it configured your shell to automatically include Homebred-based apps in its $PATH - the list of directories it searches when you don't specify one.


When you removed Homebrew, you deleted this directory, but you didn't update the shell to no longer look for it.


You should have used the Homebrew uninstall script to remove Homebrew, rather than just deleting the folder..


Either way, there are several paths forward:


Simplest - create the directory it's looking for. Even if it's empty, it will satisfy the startup script to where it doesn't complain any more. To do this, just run:


 sudo mkdir -p /opt/homebrew/bin/brew


Alternatively, edit the shell startup script to no longer reference the homebrew directory in the. $PATH variable. There could be a couple of places this is set, so it might take a little digging to find the right place.


Or re-install Homebrew, then use the official uninstall script which should take care of this cleanup.


Or just ignore it, since it's not directly causing any problems.


Your choice.

3 replies
Question marked as Top-ranking reply

Mar 12, 2021 2:56 PM in response to Dr_Tech

It's not likely a critical problem. When you previously installed Homebrew it configured your shell to automatically include Homebred-based apps in its $PATH - the list of directories it searches when you don't specify one.


When you removed Homebrew, you deleted this directory, but you didn't update the shell to no longer look for it.


You should have used the Homebrew uninstall script to remove Homebrew, rather than just deleting the folder..


Either way, there are several paths forward:


Simplest - create the directory it's looking for. Even if it's empty, it will satisfy the startup script to where it doesn't complain any more. To do this, just run:


 sudo mkdir -p /opt/homebrew/bin/brew


Alternatively, edit the shell startup script to no longer reference the homebrew directory in the. $PATH variable. There could be a couple of places this is set, so it might take a little digging to find the right place.


Or re-install Homebrew, then use the official uninstall script which should take care of this cleanup.


Or just ignore it, since it's not directly causing any problems.


Your choice.

I see homebrew when I open terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.