HomeHow To'sHow to Fix Sudo: APT-Get: Command Not Found on macOS

How to Fix Sudo: APT-Get: Command Not Found on macOS

Do you repeatedly find the Sudo: Apt-Get: Command Not Found issue on your Mac? You are not the only one who had to face this issue. Many other users have faced this too.

There are multiple reasons why some functions do not work on particular devices such as MacOS. And that is when you find the error “Sudo: Apt-Get: Command Not Found” on your Mac.

But you need not worry. This article will teach you about the various causes and alternatives for the Apt-Get command.

What Causes the ‘Sudo: Apt-Get: Command Not Found’ Error on your MacOS?

Whenever there is a Sudo: APT-Get: Command Not Found on your Terminal, it means that the command you’re trying to use for a particular application or library is unavailable.

And if the utility or application is not installed on your system, then all the utility-related commands or functions will not work.

Even though the commands on the Terminal of both Linux and macOS are almost the same, they will not use the same managers and utilities to install and manage the packages.

And MacOS won’t work since it doesn’t have this particular package manager.

Top APT Alternatives for MacOS:-

APT commands are used for downloading, updating, or upgrading applications with the help of the Terminal.

But since this option is available only for certain Linux distributors, MacOS has a few alternatives that function the same as the APT. 

These two alternatives are used for the same work as APT and come with a few different and better features to fix the Fix Sudo: APT-Get: Command Not Found error

The two alternatives methods are:-

1. Homebrew

2. MacPorts

Method 1: Install Homebrew on MacOS

The command ‘apt-get’ is meant to install packages on Linux systems, and Homebrew will perform the same functions on your Mac. 

Most users feel comfortable with using this package manager. You can easily install and use Homebrew and run command for installing the packages by following the steps given below:-

Step 1: The first step is to Open the Mac App Store, search for Xcode, and download it.

Step 2: Next, open the Terminal and run the following command to install the Xcode command tool.

xcode-select --install

Step 3: After the above command is successfully implemented, either type or copy the command below on your MacOS to install Homebrew on your macOS.

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

The installation process will ask for the Return (Enter) key and your password for confirmation.

Step 4: And, once it is installed, check and verify it with the following command:

brew -v

Step 5: Next, open Homebrew and then type the following command, “install package_name” command for installing the software you desire on your Mac.

Step 6: The brew command will install the package on your macOS.

Step 7: After, installing the package you desired, then finally enter brew and your install name: brew install name.

The brew command is not available out of the box, but it will start working on your macOS after you install the above components. And it functions as an effective alternative to apt-get and will work with all its packages.

Method 2: Install MacPorts on macOS

Macports is another package manager for macOS. It is easy to use and a great way by which you can compile, download and manage an application and the library with the help of a single command.

But before installing any program with MacPorts, you must use the command ‘sudo’. And without it, you will be unable to manage your applications, as you will have to confirm that you are the system user.

You can easily install it by following the given steps:-

Step 1: First open the app store from the dock and find Xcode.

Step 2: Then install Xcode on your Mac.

Step 3: Next open Xcode and accept all the Terms, by clicking on the agree button.

Step 4: And then start Terminal.

Step 5: Run the command given below:-

xcode-select –install

Step 6: Next, go to the MacPorts website and then download Macports for the operating system which you’re using.

Step 7: Once it is installed, restart the terminal and run this command:-

sudo port selfupdate

Step 8: And, after this, you can finally install packages by using the “sudo port install package_name“.

Installing Macports on MacOS to Fix Sudo: APT-Get: Command Not Found error

If the message ‘Updating MacPorts base source using rsync‘ appears, it means that MacPorts is successfully installed. Otherwise, it isn’t installed incorrectly.

Also Read:


If you get Sudo: APT-Get: Command Not Found then error, you will have to use a different package manager. 

After reading this article, you’ll be able to find the answers to the following questions:-

  • What Causes the sudo: apt-get: command not found error on your macOS?
  • What are the alternatives to APT for MacOS?

The process of two alternative methods are:-

Homebrew and MacPorts, which are capable of installing packages as Apt-get. And both Homebrew and Macports will not get a damaged package to work on macOS.

Jeh Dixit
Jeh Dixithttps://getthattech.com/
Jeh Dixit, a tech blogger with over six years of experience, is renowned for writing insightful how-to's, error-solving guides, and reviews. Having contributed to major tech sites, his expertise and passion for technology shine through his well-written content on GetThatTech.


Please enter your comment!
Please enter your name here

- Advertisment -
Most Popular