brew and apt used together

I have been using Ubuntu as a developer server for a long time.

I need to start developing on a product that has most of the installation instructions written for Mac.

I started to follow the instructions using APT instead of homebrew and I've found some issues where I had to google to find the right package to install.

What worries me is that the versions that I am installing are not exactly the versions that everyone else is using.

I have now installed homebrew in Ubuntu thinking to use it while working on this product.

I am wondering though if I could start having issues with applications installed by both APT and homebrew.

I can see for example that homebrew is trying to install GIT that was already installed on my machine.


Solution 1:

Homebrew officially supports Linux since v2.0.0 (February 2019).

The only issue could be related to the fact that brew put its paths (brew shellenv) in $PATH before /usr/bin/. As a brew developer says:

Why put linuxbrew's bin before /usr/bin in the $PATH, when it breaks apt packages, whereas apps installed with brew install work either way?

Because brew does not expect you to use a second package manager at the same time (and neither does apt). As for the second part of this, there is no guaranteeing that brew apps work either way. We try our best to make packages work with our dependencies but we don't develop them so we can't be sure it'll work.

Also, I like this quote:

Brew is for you — APT is for the system.

Related: https://stackoverflow.com/questions/55049608/is-homebrew-compatible-with-debian-gnu-linux