What Causes the ‘sudo apt-get command not found’ Error on macOS?
Whenever there is an error ‘command not found’ on your Terminal, it means that the command you are trying to use for specific application or library is not available. If the application or utility is not installed on your system then all the commands or functions related to that utility will not work. We all know that the commands on Terminal of Linux and macOS are 99% same. However, it doesn’t mean both Linux and macOS will be using the same managers and utilities for installing and managing the packages. In conclusion, the APT commands are not available for macOS.
Alternatives of APT for macOS
APT commands are used for download, updating or upgrading applications through Terminal. However, this option is only for a few Debian Linux distributors. So macOS have few alternatives which work the same as the APT. These alternatives are used for the same work of APT and come with a few different/better features.
Method 1: Installing Homebrew in macOS
The command ‘apt-get‘ is intended for installing packages on Linux systems. Homebrew is the equivalent for the Mac. It is the package manager that most people feel comfortable with using it. Homebrew installs packages to their own directory and then symbolic links their files into /user/local. You can install homebrew and run command to install packages by following the steps below:
Method 2: Installing MacPorts in macOS
MacPorts software is used for compiling, installing, and managing open source software. MacPorts will automatically install any required dependencies for the given port that the user is trying to install. It is easy to use; you can install, download or compile an application and library by using a single command. MacPorts also provides upgrades and uninstalls for the installed ports. You can install it by following the below steps carefully:
Fix: sudo command not foundHow to Fix ‘Add-apt-repository’ Command not FoundFixed: sudo: no tty present and no askpass program specifiedWhat Does ‘apt’ mean in Linux Distributions?