Where are the installed libs/apps/programs in Mac? - macos

There seems to be several different locations where a installed lib/app can go, depending on how it's installed. I am not sure where to look for a particular one. As far as I understand:
Preinstalled apps are in /Applications, /usr/bin, /usr/lib
Macports install things under /opt/local/bin, /usr/local/lib
Homebrew put files in /usr/local/cellar and symlink to
/usr/local/...
Compilation with a Makefile can go anywhere, usually in
/usr/local/...
What about /Library/Frameworks/ ? How is something installed there? Can I delete it just by removing the folder? Can things installed in different ways have dependencies in between? How does it work??

OS X installs system components into /System and /usr.
Some 3rd Party bits (and Apple products other than the OS) are install to /Library
Some 3rd Parties (like Homebrew) install to /usr/local
MacPorts by default installs to /opt/local and /Applications/MacPorts
Fink by default installs to /sw

Related

Brew installs not appearing in /usr/local/bin

I've installed a package using brew to a new Mac, imagemagick, and carried over a number of utilities that look for convert, a part of imagemagick in /usr/local/bin. These utilities can't find convert, using which, it's in /opt/homebrew/bin/convert.
In addition, I'm trying to get vscode to work from a command line. It's set up but running code gives the error ./MacOS/Electron: No such file or directory. Electron has been installed using brew but can only be found, again, in /opt/homebrew/bin/convert.
Any thoughts?
Since Homebrew v3.0.0, the default prefix is different depending on the chip architecture. The defaults are the following:
/opt/homebrew on Apple silicon
/usr/local on Intel
The main reason for this change was for Rosetta 2 compatibility.
It appears that you're trying to transition from an Intel machine to an Apple Silicon one. The simplest way to do this might be to reinstall all the formulae again via brew bundle. This shouldn't take very long thanks to the use of pre-built binaries.
Alternatively, you can always manually add /opt/homebrew/bin to your PATH (/usr/local is already in path).

Unistall Vim Mac Os High Sierra 10.13.6

I don't know why I ever wanted to install it on my machine.
Please can someone help me unistall it?
Haven't found anywhere tips or resources on how to do that.
I have Homebrew installed and I have already tried
brew uninstall --force vim
and
brew uninstall macvim
brew installs software in /usr/local/bin/.
In /usr/bin (since OS X El Capitan) you can only find applications that have been shipped with macOS itself, so /usr/bin/vim is part of the system and can't be uninstalled.
Tools like brew or macports should use /usr/local or /opt to prefix their installation paths.
The whole /usr directory except /usr/local is under Integrity Protection, which means that you cannot change its content even with sudo.
[...]System Integrity Protection is designed to allow modification of these protected parts only by processes that are signed by Apple and have special entitlements to write to system files, such as Apple software updates and Apple installers.[...]
System Integrity Protection includes protection for these parts of the system:
/System
/usr
/bin
/sbin
Apps that are pre-installed with OS X
Paths and apps that third-party apps and installers can continue to write to include:
/Applications
/Library
/usr/local
I don't know why I ever wanted to install it on my machine.
Well, it was already there so yeah, why did you install another one?
Please can someone help me unistall it?
We certainly can… if you tell us how you installed it as the exact method will be different if you installed it from source, via MacPorts, via homebrew, or any another method. If you even installed it, that is.
FWIW, Vim has always been installed at /usr/bin/vim on Mac OS X since forever. If $ ls -l /usr/bin/vim ends with /usr/bin/vim you can stop worrying now as your system is pretty much OK. If not, show us the whole line so that we can go further.

Can I install emacs 24.5 on OS X El Capitan without deleting the native OS X emacs?

I want to install the latest version of emacs, but if I do this will it be in conflict with the version that comes pre-packaged with os x? Do I need to delete the native emacs? Also, it seems emacsforosx.com is a popular option, but I lot of people swear by homebrew... why would I go with one option over the other?
There is no reason to remove the system-supplied Emacs; any well-behaved, properly packaged third-party version will install fine alongside, not over, the system binaries and libraries.
Installing a current version of emacs is normal practice because the OSX provided version is outdated. You have a number of options, but I've found using the 'homebrew' method the easiest.
Due to changes in OSX 10.11, you need to take some additional steps when installing homebrew. If you already have homebrew installed, you will probably need to 'fix' the permissions on /usr/local. If you don't have homebrew installed, then there are some additional steps you will need to take to create the /usr/local path. This is documented on the hombrew site at El Capitan and Homebrew

Best place to install Jython on Mac

I'm trying to install Jython on my Mac (Snow Leopard). The installer prompts me to install it under
/Users/myusername/jython2.5.2
However this seems to be an inappropriate place to install an interpreter core, library modules etc...
Any suggestions as to where might be a more appropriate folder... What about
/User/bin/jython2.5.2
Would there be any side-effects of doing this?
I would go with /usr/local/bin, as that is the standard directory for user-installed binaries in the rest of the *nix world. Plus, it's already in your PATH. Using Homebrew helps managing these things.
If you use Homebrew you don't have to worry about these things.
brew install jython

Ignoring Fink's texlive in favor of a modern distribution

I have installed the latest version of MacTeX-2010, an oft-updated distribution of texlive. However, after my last fink update-all, fink insists that its version of texlive (from 2008) is a requirement. My question is,
What should I do after installing fink's texlive so that my system completely ignores fink's version?
I am using OS.X 10.5.8 with fink 0.29.14.
It's all about paths.
Fink arranges to have /sw/bin in front of /bin and /usr/bin on your $PATH (so that fink tool can override the system tools). You need to arrange to have you 2010 tex installation come ahead of the fink one.
The usual place to do this would be in your .bash_profile (login shells) or .bashrc (non-login interactive shells) .
There may be other paths which need diddling, too.
An alternative would be to work with fink (talk to the current texlive maintainer, take over the texlive maintenance, or start a mactex package) to get a sufficiently up-to-date package.

Resources