If you want to install software on a Debian-based Linux distro, apt-get is a reliable terminal command. However, you may occasionally run into trouble with the “command not found” error as a response.

Here’s how to deal with the “apt-get: command not found” error.

What Is apt-get?

The apt-get tool is a command line package manager for Debian family distros. It allows you to install, update, and remove software. Its usage is as follows:

So to install, say, the scrot screen capture software, you would use:

Strictly speaking, apt-get is deprecated, which means that it should not be used for any interactive installation (i.e., hitting Y or N or inputting any other commands on request). Instead, the shorter apt command (which includes apt-get commands) is encouraged, while apt-get is approved for scripts.

However, if you simply need to install some software, both work.

But what if apt-get doesn’t work?

Getting “apt-get: command not found” on CentOS or RHEL?

The apt-get command usually works without a problem, but what if it doesn’t?

If you’re using a distribution that doesn’t use apt-get, then it simply won’t work. (This is an easy mistake to make when accessing a remote webserver, for example.) To resolve this, you must install using the correct package manager.

This might be pacman, or zypper, or yum or dnf, depending on the Linux distribution.

For example, if you were dialed into a CentOS server and wanted to install software, instead of apt-get (or apt) you would use yum:

(Where “PACKAGE_NAME” relates to an available package for installation.)

Ourcomparison of apt, yum, and dnfexplains this further.

Fixing “apt-get: command not found” on Debian, Ubuntu, or Raspberry Pi OS

What if you’re using a Debian family distro such as Ubuntu or Pop!_OS or Raspberry Pi OS and you encounter the “apt-get: command not found” error?

Incredibly, this could happen, but what can be done to fix it?

Raspberry Pi OS users may find thatapt-get install(orsudo apt-get install) doesn’t work. In this case, tryapt installinstead.

Also, if you attempt apt-get install and there is a different error (along the lines of “Temporary failure resolving” followed by a server URL) then the issue is about connectivity. So, do the following checks:

After making the necessary adjustments, reboot the computer and try again.

Other Ways to Fix the “apt-get: command not found” Error

A trio of other problems could result in the “apt-get: command not found” error.

First, are you spelling the command correctly? Typos can cause havoc in any text focused system, from Google search to finding words or phrases on a page. The Linux terminal is no different. Take the time to ensure you have entered “apt-get” correctly.

Second, could it be that your permissions are inadequate? Instead of “apt-get” try “sudo apt-get”–the “command not found” error should now be cleared.

Finally, if you find the more specific “sudo: command not found” error pops up, and you’ve tried everything above, the issue might actually be with sudo, rather than apt-get. Check our guide tofixing a sudo: command not found error.