Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Linux»sudo apt-get Command Not Found? Here’s How to Fix It

sudo apt-get Command Not Found? Here’s How to Fix It

Nishant AryalBy Nishant AryalAugust 19, 2022
sudo-apt-get-command-not-found

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.

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

Table of Contents

  • What is sudo apt-get Command?
  • Probable Causes of this Error
  • How to Fix sudo apt-get Command Not Found?
    • Install apt-get
    • Install Sudo
    • Use Native Package Manager
    • Perform a Fresh OS Install
  • How to Fix Sudo apt-get Command Not Found on Mac?

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 the sudo apt-get command not found error. 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, execute thelsb_release -a command. 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.

Install apt-get

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

  1. Go to this link and search for the latest apt package.
  2. Now, download the package using this command. Paste the name of the latest available package after the apt/ of this command. You might need to be logged in as a root user to execute these. wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg-dev_1.6.16_i386.deb
  3. Now install the package with this. sudo dpkg -i libapt-pkg-dev_1.6.16_i386.deb
    sudo-dpkg
  4. If you are not able to use the commands because of the sudo involved in it, try this alternative command-line pkexec dpkg -i libapt-pkg-dev_1.6.16_i386.deb
  5. When asked for Press ‘Y’. This process will install the apt packages in the system.

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:

  1. First of all, update the apt cache with this command. apt update && apt upgrade 
    apt-update
  2. Now Install sudo. apt install sudo

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.

Package ManagersLinux Distributions
yumRed Hat Linux, Fedora, Cent OS
pacmanArch Linux
tgzSlackware
dnfVersions from Fedora 18
Zypper OpenSUSE

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,

  1. First of all, install the Xcode IDE with this command. xcode-select --install
  2. When asked for confirmation, Click on Install.
    install-xcode
  3. Now, that the Xcode is installed, use the curl command to install the Homebrew package manager. $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    command-in-mac-terminal
  4. Enter the system password when asked. This will start the installation process. 
  5. Restart the terminal, and now you will be able to use the sudo apt-get command on your mac. 
fix
Nishant Aryal
  • LinkedIn

Nishant is an enthusiast who loves writing about technology. He also is heavily invested in keeping himself updated about the latest happenings in the tech world. At Tech News Today, he covers Operating Systems, how-to-topics, and Fixes.

Related Posts

how to change boot order on linux

How to Change Boot Order on Linux

December 16, 2022
make-command-not-found

How to Fix “Make: Command Not Found” Error

September 20, 2022
linux terminal for windows

How to Install Linux Terminal on Windows

September 19, 2022
How-to-force-Quit-an-app-on-Linux

How to Force Quit an App on Linux

August 30, 2022
best linux for virtualbox

8 Best Linux Distros to Try in VirtualBox

August 30, 2022
ifconfig command not found

How To Fix “ifconfig Command Not Found” Error?

December 18, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
what-does-collate-mean-on-a-printer

What Does Collate Mean on a Printer?

March 31, 2023
usb-vs-pcie-wifi

USB Vs PCIe Wi-Fi—Which One is Better?

March 31, 2023
how often to replace laptop

How Often Should You Replace a Laptop

March 29, 2023
You may also like
computer suddenly slow

Why is My Computer Suddenly Slow? 11 Ways to Fix It

March 31, 2023
HTTP-Error-431

How to Fix HTTP Error 431

March 31, 2023
scheduled task reboot

How to Create a Reboot Scheduled Task in Windows

March 31, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.