Linuxbrew no such file or directory error

I’m having some trouble with my shell. It’s outputting bash: /home/linuxbrew/.linuxbrew/bin/brew: No such file or directory before my prompt every time I open a terminal.
This happened after I had problems setting up bluefin-cli. I got some systemctl errors and then some group permission errors once I entered the distrobox.
For now, I just want to get rid of that message because it’s pretty annoying. I’ve tried looking around bashrc to see if it was trying to source a missing file but I couldn’t find anything. Any help would be greatly appreciated. I’m on bluefin-dx.

2 Likes

Yep, the team is working on this.

3 Likes

I see. I found the issue on GitHub. Thank you for the quick reply.

2 Likes

Can you share a link to the issue? Thanks!

I thought it was this one, but after reading it, it doesn’t really seem related. Sorry.
I did some grep’ing around though and it seems that this is caused by either (or both) homebrew-env.sh and brew.sh using the /home/linuxbrew/.linuxbrew/bin directory when it only exists in the distrobox:

choicewake@bluefin /etc/profile.d🔒 
📦 $ cat homebrew-env.sh 
# shellcheck shell=sh

PATH="$PATH:/home/linuxbrew/.linuxbrew/sbin"
export PATH
HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew"
export HOMEBREW_REPOSITORY
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export HOMEBREW_PREFIX
HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
export HOMEBREW_CELLAR
choicewake@bluefin /etc/profile.d🔒 
📦 $ cat brew.sh
export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin
export HOMEBREW_NO_AUTO_UPDATE=1

Since they’re in profile.d, the shell tries to source them every time I open a terminal.
A fix would probably involve making the shell run these two files only when inside the distrobox, but I don’t know enough about how bluefin is structured to actually do that.

fix: polkit policy for user-networked-tasks by bketelsen · Pull Request #954 · ublue-os/bluefin · GitHub is an inflight PR looking to fix it. (Sorry don’t have time for more detail rn)

1 Like

where did /etc/profile.d/homebrew-env.sh come from? are these from previous homebrew installations?

The changes we added yesterday only included brew.sh, and it’s different from the one you posted.

❯ bat -p /etc/profile.d/brew.sh 
[[ $- == *i* ]] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

I just realized I ran these commands from bluefin-cli. The files I posted are from the container. Sorry about that.

You’re right. There’s no homebrew-env.sh and my brew.sh looks just like yours. My mistake.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.