3

Having some trouble using apt on my Mac. If I run sudo apt search or sudo apt-get I get this error in the terminal:

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

I am running Sierra 10.12.4 and am trying to use the md5sum command on Mac.

Any thoughts on this?

  • 3
    When did Mac start supporting apt ? The apt utils are from Debian Linux. – ivanivan Apr 15 '17 at 18:07
  • I am not really sure, they may not, I just don't ever use things like that in terminal on the Mac. If I use the terminal I usually use Ubuntu, was just trying to get md5sum to word on Mac @ivanivan – BenRichi_ Apr 15 '17 at 18:12
  • @RuiFRibeiro what extra information do you need to know? – BenRichi_ Apr 15 '17 at 18:13
  • I wrote that before the md5sum comment...Google for MacPorts or HomeBrew. – Rui F Ribeiro Apr 15 '17 at 18:13
5

apt, the package manager, is a Linux tool, from Debian GNU/Linux. macOS does not have it.

There are projects like Homebrew, MacPorts and Fink that provides packaged third-party software for macOS.

NetBSD's pkgsrc also works nicely on macOS: http://www.pkgsrc.org/

As for md5sum: On the BSD Unices, of which macOS is one, there is often a utility called md5 available that performs the same service (but with slightly different format of output).

If you install GNU coreutils using the tools provided by one of the above projects, md5sum will be installed. The executable is sometimes called gmd5sum (note the added g prefix, which also gets added to all other GNU coreutils executables).

  • Okay, that makes a lot of sense, I think that I am going to have a look into Homebrew for the future, but have just read the manual for md5, does the job I wanted, thank you! – BenRichi_ Apr 15 '17 at 18:30
  • @BenRichi_ If you decide to go with one of the package managers I mentioned, do spend some time reading up about them. Homebrew is the most confusing one that I've used (but that may be because I'm more used to NetBSD's pkgsrc which is very similar to OpenBSD's ports system, which I'm using every day anyway). MacPorts worked well for me when I used it. – Kusalananda Apr 15 '17 at 18:42
  • Okay sure thing, I appreciate the advice, will have a good look into all of the options and decide which one I want to try out! – BenRichi_ Apr 15 '17 at 18:49
  • apt is a Debian tool; Linux is just a kernel. – ctrl-alt-delor Apr 15 '17 at 21:51
2

macOS doesn’t use the APT package management tools, at least not by default. Here you’re ending up trying to run Java’s annotation processing tool.

If you want to check out package management tools on macOS, see How to install apt-get or YUM on Mac OS X; Fink allows you to install apt-get.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.