Nutmeg
Nutmeg

Reputation: 221

apt install unable to locate executable

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!

Upvotes: 20

Views: 32186

Answers (2)

Ben H.
Ben H.

Reputation: 291

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

Upvotes: 29

eheller
eheller

Reputation: 147

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

Upvotes: 1

Related Questions