Skip to content

Apt-get command not found: 5 Fixes

APT, otherwise known as Advanced Packaging Tool, is a package management system used by Debian based Linux distros to configure, compile and install software from the internet. 

It makes installing software extremely easy as all you have to do is type a command and hit enter. However, APT in itself isn’t a single command but more like a package of tools users can use to manage programs on their Linux computers.

In this article, we’re looking at apt-get command not found errors on Linux and Mac and how you can fix them.

Also read: Debian vs Ubuntu: Which Linux distro should you pick?


How to fix apt-get command not found on Linux?

If you’re on a Linux machine, follow these steps to resolve your error. 

Check your Linux distro

As we’ve mentioned above, not all Linux distros use apt-get by default to fetch and install programs. Distros have their own choice of package managers, and depending on which one you’re using, you might have to use something else such as yum or zypper. 

Here’s a list of popular Linux distros and the package managers they use. 

DistroPackage management systemPackage Manager
Red Hat LinuxRPM-basedyum/dnf
FedoraRPM-basedyum/dnf
CentOSRPM-basedyum/dnf
Amazon LinuxRPM-basedyum/dnf
openSUSERPM-basedzypper (for CLI)
YaST (for GUI)
DebianDEB-basedapt/apt-get
UbuntuDEB-basedapt/apt-get
Kali LinuxDEB-basedapt/apt-get
Arch LinuxPacman-basedpacman
GentooPortage-basedportage 
SlackwareSlackPKGpkgtool/slackpkg

Check APT path 

If you’re getting this error, the chances are that either APT isn’t installed or is in some other location other than the default path.

Type the command below to check the path of the APT binary. 

locate apt-get
Apt-get command not found: 5 Fixes | Candid.Technology

If the command outputs something similar to the screenshot above, you’ve got APT installed. If there’s no output, you need to reinstall APT.


Installing APT from scratch

Another quick solution is to install APT from scratch and avoid jumping through any hoops. 

Step 1: First up, we need the deb file for the APT package. Head over to this link and click on the latest version of the APT package. In this case, it’s apt_2.3.6_amd64.deb

Apt-get command not found: 5 Fixes | Candid.Technology

Step 2: Once you’ve downloaded the package, run the following command to install the package file. Make sure to add the correct path to the downloaded deb file. 

sudo dpkg -i path/to/deb/the_deb_file.deb
Apt-get command not found: 5 Fixes | Candid.Technology

The APT commands should work just fine now.


Reinstall the OS

If the above methods don’t work, you’re going to have to reinstall the entire OS. Make sure to install an OS that uses APT as its default package manager, such as Ubuntu or Linux Mint. 

Also read: Syntax error near unexpected token: 3 Fixes


How to fix apt-get command not found on macOS?

You’re seeing the ‘command not found’ error on your mac because macOS doesn’t use the APT package for installing or updating programs. However, there are macOS alternatives available for APT, the most popular one being Homebrew.

Here’s how you can install Homebrew on macOS.

Step 1: Hold the Command key and press Space to open Spotlight. Type terminal and hit enter.

Step 2: Now install Xcode command-line tool using the following command

xcode-select --install

Step 3: Now, we can install Homebrew using the command below.

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

Wait for the installation to finish. You may be prompted for your password during the process.

Once Homebrew is installed, you can install packages using this command.

brew install <package name>

Also read: How to add a user to a group in Linux?

Hello There!

If you like what you read, please support our publication by sharing it with your friends, family and colleagues. We're an ad-supported publication. So, if you're running an Adblocker, we humbly request you to whitelist us.

Share on facebook
Share on whatsapp
Share on twitter
Share on reddit
Share on linkedin
Share on pocket
Share on pinterest
Share on telegram
Share on stumbleupon
Share on digg
Share on tumblr
Share on email
Share on skype
Share on xing
Share on vk
Share on odnoklassniki
Share on mix








>