(FIXED) Apt-get command not found on Mac
If you have used a Linux system before, you may be familiar with the Apt-get command. It is used to install applications 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 much more likely to be able to run a Linux application.
Can’t find the apt-get command?
The message Apt-get command not found appears when users try to install a Linux application with a command. There is nothing wrong with the apt-get command, but it doesn’t work in macOS. macOS does not have this special package manager, so it does not work.
How to fix apt-get on a Mac
This does not mean that you cannot install the Linux package on macOS. Use only another tool.
If you know Linux, you also know Homebrew. It is available for macOS and can be used to install packages.
- Make sure you have Xcode installed (Observe: Get it from the Mac App Store)
- Open the 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.
- After the installation check with this command:
- Now you can install packages with this command:
brew install Name_of_package
Observe: You can install Homebrew on the Windows 10 subsystem for Linux.
Macports is another package manager for macOS. It works just as well as homebrew, but in general you should choose only one of these two.
- Make sure you have Xcode installed. Download it from the Mac App Store.
- Open Terminal.
- Throw it Order:
- Confirm what you want install Xcode tools.
- Download Macport for your macOS version.
- Run the PKG file and install Macports.
- Install packages with this command:
port install Name_of_package
Apt-get does not work outside of Linux. You will eventually need to use another package manager. macOS is built for BSD, and BSD is similar to Linux. This is quite difficult in terms of technology, which is why the apt-get command cannot be used on MacOS. Homebrew and Macports are able to install packages as well as Apt-get. If you can’t install the package with Homebrew or Macports, or if it doesn’t work after installation, it’s probably a bug in the package itself or in other dependencies that can be fixed. Homebrew and Macports cannot make a damaged package run on macOS.