Brew using a custom bashrc

Hello,
Stumbled into Aurora on my Fedora Atomic journey. I have to say I love it. Out of the box it is more feature rich than Kinoite (which I still enjoy) and the applications included just feel right.

Anyhow, the reason for my post is I’m having a heck of a time with a custom .bashrc file I use across my systems. When I put it in place, I lose access to Brew (which I have never used but looking at since its here). I’ve looked at bashrc in both /etc and /usr/etc and I can’t figure out the path. I ran which brew and it goes to /home/linuxbrew/.linuxbrew/bin but that doesn’t seem right to me.

I’m thinking its a path issue but I’d like to know how its setup first and adjust my custom bashrc file accordingly.

Thank you again and I hope I can contribute in some way in the future. I think this may be my main distribution I put my girlfriend and parents on when the Windows 10 end of life happens.

Edit: Did figure out the path and yep, it is /home/linuxbrew/.linuxbrew/bin and found the sbin as well. Would still like to know where it is pulling its information by default.

Hi all,

Sorry about this, I thought this was a reasonable guess at what would fix it. Clearly I assumed incorrectly. Please disregard this post. Thank you @rrenomeron for the correction!

Hi ZacAttack,

Can you run the following command (It will add ~/.linuxbrew/bin to your path.) and logout then back in (or reboot)?

echo 'export PATH="$PATH:/home/linuxbrew/.linuxbrew/bin"' >> ~/.bashrc

I think that’s all you should have to do if you use BASH (The default). If you don’t, let me know and I can modify it!

Thanks, Good luck,

  • Dan

It’s not just a path issue. There are a couple of other environment variables you have to set, which the brew binary can do for you. Run:

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

and the correct environment variables have been added to your shell.

The code that does this is in /etc/profile.d/brew.sh, which is sourced, along with everything else in /etc/profile.d, by the default /etc/bashrc.

2 Likes

Thanks for the correction! I’ll update my post.

Neat. I didn’t think to go into profile.d. I appreciate the response. I may have to dive into brew more and I’ve heard about it from the Mac world but didn’t think it made it to Linux.

I might take the default bashrc and go from there as opposed to the one I took from ParrotOS a while ago.

Thank you again.

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