Sudo apt-get is a frequently used command line to manage the Debian packages. However, if you use this on a non-Debian device or if the apt package is not installed, you will get the Command not found error when trying to execute it.

Additionally, when this error pops up, users won’t be able to install, remove, update or manage the software packages.

sudo-dpkg

In this article, we will cover this issue and help you find a resolution to this command error.

What is sudo apt-get Command?

The Linux repositories have different packages available for the users. These packages can be installed using the apt-get commands. apt is simply a package manager that is used to install, remove, and update packages.

Probable Causes of this Error

apt-get commands are supported only by Debian-based distros like Ubuntu. However, if you are trying to use apt packages on Rpm-based distributions, you will get thesudo apt-get command not founderror. This error will also pop up if the location path for the apt package is missing.

How to Fix sudo apt-get Command Not Found?

The first step is to check if you are using a Debian-based operating system. To see which distro you are using, executethelsb_release -acommand. This will give the description of the distribution and its current version.

If you have confirmed that you are using Debian Linux, then use these fixes to resolve the problem.

apt-update

Install apt-get

The major reason for the sudo apt-Get command not founderror is if it is not installed. To install the apt packages perform these steps,

Install Sudo

In the minimal Debian versions, the sudo isn’t installed by default. You might get the command error in such a condition.

To install the sudo, follow these steps:

Use Native Package Manager

If you have a Linux distro other than Debian, apt-get package manager will not work for you. You have to use the native ones for your system. The list of different package managers with their compatible Linux distros is listed here.

Perform a Fresh OS Install

If none of the fixes work, you must perform a fresh install of the OS. It is recommended that you download a non-minimal Debian distro and install it. These distros come up with lots of features and packages pre-installed. Ubuntu, Pop!_OS, and Zorin OS are some of the popular Debian Linux distributions.

How to Fix Sudo apt-get Command Not Found on Mac?

The macOs Terminal doesn’t directly provide support to the sudo apt-get command. However, you can use the Homebrew package manager to get it working. If you are trying to use the apt-get without having installed a supporting package manager, you will get the command not found error.

To install the Homebrew,

install-xcode

command-in-mac-terminal