Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apt install unable to locate executable

Tags:

java

macos

apt

I have read a few other threads similar to this one on stack overflow, but I've been unable to solve my problem.

I am trying to install a package.

apt install libgnutls28-dev

however, I get the following error.

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/apt" (-1)

Other people have been able to solve this error by setting the java home environment variable in the terminal.

export JAVA_HOME=/Library/Java/Home

I have tried this, and then run apt install again, but recieved the same error:

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/apt" (-1)

Any help is appreciated!

like image 450
Nutmeg Avatar asked May 27 '16 23:05

Nutmeg


2 Answers

Hey I encountered this when trying to install libsndfile. Turns out I was reading their instructions for Debian/Ubuntu. apt isn't a thing on macosx. You'll want to use an alternative package installer like brew.

https://unix.stackexchange.com/questions/359219/error-when-using-apt-on-macos-sierra

like image 164
Ben H. Avatar answered Nov 09 '22 23:11

Ben H.


export JAVA_HOME should point to the directory where the JDK or JRE is installed.

JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") in a console or directly in .bashrc should do the trick under debian

like image 1
eheller Avatar answered Nov 09 '22 21:11

eheller