If you’ve ever used a Linux system, you may be familiar with the Apt-get command. It’s used to install apps or packages. macOS and Linux have some similarities and a very small number of Linux packages can be installed on macOS. Older versions of macOS are far more likely to be able to run a Linux app.
Apt-get command not found?
The Apt-get command not found message appears when users try to install a Linux app with the command. There is nothing wrong with the Apt-get command but it isn’t going to work on macOS. macOS doesn’t have this particular package manager which is why it won’t work.
How to fix apt-get on Mac
That doesn’t mean you can’t install a Linux package on macOS. You just have to use a different tool.
If you’re familiar with Linux, you’re also familiar with Homebrew. It is available for macOS, and it can be used to install packages.
- Make sure you have Xcode installed (Note: get it from the Mac App Store)
- Open Terminal and run this command:
- Accept the EULA.
- Run this command to install Homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Confirm you want to install Homebrew.
- Once installed, verify it with this command:
- You can now install packages with this command:
brew install Name_of_package
Note: You can install Homebrew on Windows 10 subsystem for Linux.
Macports is another package manager for macOS. It works as well as Homebrew but generally speaking, you should only pick one of the two.
- Make sure you have Xcode installed. Get it from the Mac App Store.
- Open Terminal.
- Run this command:
- Confirm that you want to install the Xcode tools.
- Download Macports for your version of macOS.
- Run the PKG file and install Macports.
- Install packages with this command:
port install Name_of_package
Apt-get isn’t going to work outside Linux. You will ultimately have to use a different package manager. macOS is built on BSD and BSD is what is similar to Linux. That is quite a stretch as far as technology is concerned which is why there is no way to use the Apt-get command on macOS. Homebrew and Macports are just as capable of installing packages as Apt-get. If you’re unable to install a package with Homebrew or Macports, or it doesn’t work after it has been installed, it is likely a shortcoming with the package itself or other dependencies that have to be resolved. Neither Homebrew nor Macports can get a damaged package to work on macOS.