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).
Related
I'd like to install an X11 version of Emacs on Catalina, but haven't found anything online that tells me how I might accomplish this.
The following worked for some previous versions of MacOS, including, I believe Mojave.
$ brew tap d12frosted/homebrew-emacs-plus
$ brew install /emacs-plus --with-x11
Unfortunately, at the moment, if you do this, you get only the "app" version of Emacs, not the X11 version.
The default Emacs recipe that comes with Homebrew does not currently support the "--with-x11" or "--with-x" option.
Is there another Emacs cask somewhere that supports X11?
P.S. I know that I could try to build Emacs directly from the Emacs sources myself, but from past experience, I am afraid that there be dragons along this path.
P.P.S. I seem to have gotten a working version of an X11 emacs installed by rsyncing the directory /usr/local/Cellar/emacs over from a Mac that is running Mojave. But clearly this is less than ideal, so I'm still looking for how I might accomplish this the "right" way.
I maintain my own brew formula for X11 emacs that you may be able to use. I wrote about this in a blog entry here.
This isn't really a programming question -- probably better for serverfault.com or unix.stackexchange.com, but I'll post this reply here anyway.
My last attempts to try to use homebrew to install X11 capable apps, especially Emacs, failed. Once upon a time I had edited the homebrew recipe to make it compile a local version with X11 support, but I was giving up on maintaining that against the quickly moving target of homebrew and the mass migration of homebrew away from supporting X11.
So, really your best option is to build Emacs from source and install it.
(I've moved entirely away from homebrew as a result -- I only use pkgsrc now, and that gives one an easy way to reliably build Emacs with X11 support and manage all the dependencies, etc.)
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.
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
I installed matrix2png on my Mac and had used it without problem before last week when I installed another image manipulating tool "circos". Circos requires me to install a different version of libpng, and I did. After that, I am no longer able to run matrix2png, which gives me the following error. I think the old ligpnb is not linked any more. Does anyone know how to fix this error? - appreciate your help.
dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /usr/local/bin/matrix2png
Reason: image not found
Those step solve my problem:
brew versions libpng
You will see some versions of libpng, but unfortunately not 1.5.15, so next you should install 1.5.18.
git checkout 7bec702 Library/Formula/libpng.rb
brew install libpng
You'll will find version 1.5.18 and some another versions.
ln -s /usr/local/Cellar/libpng/1.5.18/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib`
See https://github.com/Homebrew/homebrew-php/issues/1055
Some more info on installing certain versions of brew formulas can be found at https://coderwall.com/p/lqphzg.
Your new version of libpng has probably changed the name of its dyld files. This often happens with upgrades (especially following a major release). To verify this, open up the terminal and type:
ls /usr/local/lib/libpng*
What do you see?
From your error message we know that matrix2png is looking for libpng15 but if you've upgraded when instaling circos then you may now have libpng16 on your system. Consequently matrix2png won't be able to find the files that it's looking for and will be unhappy.
Fixing it this time:
Try re-installing matrix2png and see whether it notices the dependency issues and fixes it for you. You don't really want to downgrade libpng nor do you want to have two versions of it on your system, so having an up-to-date version of matrix2png would be good.
It looks like matrix2png comes from C source code, so you'll want to rebuild it. Download the source code or and then open a terminal. Navigate to the folder with the source code and run configure and then make. Configure will generate a Makefile for your system, and then make will use that file to generate a new binary. I've tested this on my Mac (with libpng16), and found that matrix2png built without any errors.
Suggested future approach:
To prevent future linking problems, you may want to use a package manager like homebrew or macports. In case you're using (or want to use) homebrew, it has circos and lib2png (but not matrix2png, sorry!). Once brew is installed, type the following into the terminal:
brew install libpng
And it should detect linking issues / version conflicts and guide you through fixing them. Brew places all of it's files in a 'cellar' location in /usr/local/Cellar and then symbolically links them into your system.
In case you're already using brew, try brew doctor and follow the instructions to resolve problems.
My experience (I've been dealing with a lot of version conflicts in the past few weeks) is that package managers make life much easier. Occasionally I've had to remove and reinstall packages to fix version issues, but in general brew keeps things neat and working.
I am using MacBook Pro Mac OS 10.5 with related version of XCode. I am new to this development environment. I am learning macports, and I read information about macports from http://www.macports.org/. But I am still confused what macports is after reading information from this site.
I am previous working on Windows and Linux, could anyone let me know what macports is (in easy words) and what is the similar item on Windows/Linux?
thanks in avdance,
George
macports is a way of getting executables and other compiled code installed on your computer without having to work out the details of compiling/linking each apllication.
It is equivalent to a package manager under Linux and other Unicies. There is no direct equivalent under Windows.
It is just a convenient way to install a lot of *nix soft on your mac book. They are installed separately (not overwriting) from binaries/daemons/libs already installed on your mac (by default in folder /opl/local). Also they are much fresher than those installed on your mac.
For example 10.6 ships with bash 3.2, but after running sudo port install bash, you will get version 4.x (to make it your default shell add /opt/local/bin/bash to file /private/etc/shells, run chsh -s /opt/local/bin/bash and reopen terminal).
Note other os x package managers: fink and homebrew (superuser question)