Is it possible? Yes. Both programs are open source.
Is it convenient? Not really.
Why?
Package managers work more or less like this:
- They track packages installed on your system(and their version)
- To do this, they specify their own format of packages(e.g. .deb), and use these packages as instructions on how to install the program and how to track it
- They also track dependancies (e.g. "this program needs openssl to work!")
This is why having a system that would use few package managers isn't the best idea:
- Each package manager would have to be informed about the package being installed(e.g.
brew would have to know that you installed firefox, and apt would have to know that you installed tldr)
- Each package manager would have to resolve dependancies from other package managers(e.g. "Brew: This program needs
ncurses, but apt already installed ncurses, so I don't need to pull them!").
You see, the problem with 2 is that package managers are abstraction for the underlying repositories. People like Debian folks choose the packages they want users to use, and they make them available to others. However, they also select these packages so that system is consistent; they want the least amount of packages to offer the most functionality. Why install ncurses version 1,2, and 3, when you can get everything to work with version 2?
The first problem is also bad news. The package managers would have to inform each other about what they do, or they could collide(brew wouldn't know that ncurses is already installed).
So why is it hard?
- Package managers would need to cooperate tightly
- Package managers would have to have strict policy about what to do when they can't agree on package
- Package managers would have to be able to work almost interchangebly, with the only visible difference being available programs
- Package managers would have to be able to track each others' repositories in case of updates.
This effectively means you would need a package manager that would consist of the two package managers. You would need a new program.
So what can I do?
First of all, I would ask myself "Why do I want to do this?". Honestly, your distribution should supply you with plenty of packages. If you aren't happy with how many packages you have, you might consider switching to other distribution that has more packages that you need.
If you are really desperate to get this brew to work, I would propose the following solution, although I'm not sure if this is fully possible:
- Grab the sources of
brew.
- Learn the brew recipes format.
- Write a program that automatically translates recipes to Debian packages.
- Modify
brew so that whenever you run it, it calls the program to translate recipes to .deb packages/searches for the programs in your distro's repos, then call apt to install this package.
Making such modifications would probably take much time and isn't the easy thing. I suggest changing distro or sticking to your package manager instead.