apt: command not found on Ubuntu or Debian

command-not-found

Updated August 29, 2026

On Ubuntu and Debian, apt is the package manager command. If the shell says apt: command not found, first confirm that you are actually running a Debian-family system; Fedora, Arch, Alpine, and macOS use different package managers.

command -v apt
cat /etc/os-release

On a normal Ubuntu installation, apt is part of the base system. A damaged or unusually minimal image may need repair from the distribution's recovery tools, not a package named “apt”. In scripts, use the non-interactive apt-get interface when appropriate:

sudo apt-get update
sudo apt-get install package-name

If the error is sudo: apt: command not found, compare the paths seen by your user and by sudo:

command -v apt
sudo sh -c 'command -v apt'

Avoid downloading an apt binary from an untrusted website. Identify the operating system and use its official package documentation instead.

Sources

related.

Ruslan Osipov

Ruslan Osipov

About the author