Is there a way to get Homebrew to recognize that a dependency is already installed outside of Homebrew?
For example, I prefer to install programming languages via a tool like asdf/nvm/rvm/etc so I can easily manage multiple versions. However, if a Homebrew formula lists node, for example, as a dependency, Homebrew will install another version of node that will never actually get used.
Can I tell it I already have node installed?
Homebrew is build/distribution tool, it does not manage user specific stuff nor it does have permissions to do it.
brew install process is in install.rb, you can check out more for details.
All the core team maintained formula are in homebrew-core and cask formula are in homebrew-cask.
Related
Im trying to get something running in a lab, and I need to install a whole bunch of packages to compile the code:
sudo apt-get install build-essential libgtk2.0-dev libwxgtk3.0-dev libwx-perl libmodule-build-perl git cpanminus libextutils-cppguess-perl libboost-all-dev libxmu-dev liblocal-lib-perl wx-common libopengl-perl libwx-glcanvas-perl libtbb-dev libxmu-dev freeglut3-dev libwxgtk-media3.0-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libcurl4-openssl-dev libextutils-makemaker-cpanfile-perl
The problem is, I'm working on a Mac; So I only have brew available - and the package names are not equivalent.
Am I trying to do something dumb and impossible, or is there a way to cross reference those apt-get packages to ones available in brew and install those so I can build the app?
For added context, its a modified "slicer" application for generating files that a 3d printer uses to make parts. I could fire up an ubuntu VM and use apt-get, but I'm on an M1 mac at the moment and recompiling experimental QEMU code just so I can fire up an ubuntu VM takes me way more out of my depth than I already am... I'm running brew on a duplicated, rosetta emulation forced terminal.
There is no straightforward way to automatically figure out whether a corresponding Homebrew package exists for each of these packages, no. But you can probably guess the majority, and manually figure out the rest. Each Debian package has a link to the upstream sources, and a home page if one exists, from which you can often find links to packages for other architectures, etc.
From the Debian package search page you can search e.g. for the libxmu-dev package, and discover the corresponding package page for Buster (the current stable Debian release), which in turn has links to the upstream repo, etc. But this is an X11 package, so it's not straightforwardly compatible with macOS, which uses an entirely different GUI architecture.
I know, that Homebrew doesn't upgrade casks with auto-update (without force). So eventually, software versions, actually installed, and tracked by Homebrew, become different. For example:
$ brew cask outdated --greedy
firefox (79.0) != 80.0
google-chrome (84.0.4147.105) != 85.0.4183.83
microsoft-edge (84.0.522.48) != 85.0.564.41
Firefox, Chrome and Edge auto-updates themselves and actually has latest versions. But Homebrew doesn't know about it.
So, is there a way to tell Homebrew, that some cask is the latest version already, without reinstalling cask with brew? Just update record in Homebrew database (or whatever brew stores casks' versions in).
Apparently, there is no official way to do it.
Following related GitHub conversation I wrote my own script to fulfil my obsession of checking versions :)
If anyone wants to use it — use it on your own risk, you will get no support for issues that arise from this approach. Also, I tried to make neat and robust script, which backups data, but if script will remove any of your data — I'm not responsible for that. I encourage you to read the script and understand, what it is doing.
I was wondering if there would be any issues with installing Nix and Homebrew on the same system?
I know Homebrew tends to install things all over different directories, but from what I have read, Nix is very clean. If I understand this correctly, Nix installs it's packages all within one single directory.
So if this is the case, could I try running them both side-by-side? I would be careful not to install too many of the same packages from both places in (ie. I wouldn't install grep, htop, or whatever else from both Homebrew and Nix and if I did I would take precautions).
Side-note: This would not be permanent. I am thinking about switching from Homebrew to Nix (just to mix things up a bit), and I wanted to try Nix on my main machine before taking the leap (if at all). I know I could just try Nix on a VM, but I would not get the same experience unless I tried it on my main system. So it would be nice to install it along Homebrew and give it a shot before going through the pains of removing Homebrew and replacing all my Homebrew packages with Nix packages.
Yes, you can install Nix along side Homebrew.
Nix will install all it's packages within /nix/store For example, on my NixOS system vim is currently installed in /nix/store/j6nrk9h1rpxrzmccm0yq520ik625gd1q-vim-8.1.0578
Your shell will choose whether to use a package from Nix or Homebrew, according to how $PATH is set up. For example, if it so happens that the Nix paths are first, then they will take precedence.
Note
A common source of confusion is that install means something different on Nix. When you install a package, such as Python, it becomes part of a Nix environment, and as such can be executed without specifying the full path; Just as you'd expect from any package manager.
However, if you install a package which has, say, Python, as a dependency, Python would get installed, but more likely than not it would not be included in the environment. Hence it can only be executed via the absolute path.
On a related note, due to a similar reason, if you install a library with Nix and then try to compile against it outside of Nix, it will not work; The build tools will not find the library.
What is the difference between brew installation and pip installation in mac
Is there any supporting packages ?
Please give me some good ways to install ansible
brew install ansible
I prefer a installation via brew. I see the following pro's:
integration better geared towards mac (pip is more general purpose)
I try to install everything via brew (not pip for python, npm for javasscript...)
upgrade mechanism seems better to me (as far as I know upgrading every pip package is a bit hacky)
The ansible documentation recommends installation via pip :
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#control-node-requirements
I trust the product documentation more than the hearsay. Arguments like "I try to install everything via brew" do not apply here.
I recommend using pip as well, with a good python versions management and virtual environment.
I am using myself a combination of pyenv + venv (the latter is a module in recent versions of python in the standard library) and run Ansible on a control node in Mac OS in a python virtual env. It gives full control and definitely is not "hacky". The brew way is relying on system python on the other hand puts ansible in a Cellar site packages, ties it to a particular version of python with all its consequences and surprises.
To the OP - please read the ansible user guide and getting started documentation first before asking "please give me one sample".
How to use macports and homebrew package management systems together without having them interfere with each other in bad ways?
It's best to use just a single package manager and uninstall the others. If, for example, you want to use MacPorts, but there's a program you need that's not in MacPorts, consider filing a MacPorts port request ticket.
If you insist that you must install multiple package managers, then please install all of them in nonstandard prefixes. MacPorts' default prefix is /opt/local. Homebrew defaults to /usr/local. Fink uses /sw. Build each package manager from source manually, selecting a unique install prefix for each that is different from all of the preceding default paths. This is to ensure that software packages that have hardcoded knowledge of these package managers' default paths do not inadvertently find dependencies from the wrong package manager.
When you install a port with MacPorts, it clears most environment variables; this is to ensure that, even if you have, say, /usr/local/bin and /sw/bin in $PATH, MacPorts will not find things there. I don't know whether Homebrew and Fink do this too; if they don't, change your $PATH so that it doesn't contain locations with potential third-party dependencies, before you install anything using Homebrew or Fink.