auto-apt-proxy command not found

In this troubleshooting guide we learn how to fix auto-apt-proxy command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

auto-apt-proxy: command not found

or when using sudo you get the following error message

sudo: auto-apt-proxy: command not found

Solutions to auto-apt-proxy: command not found

How To Fix auto-apt-proxy: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu auto-apt-proxy is provided by auto-apt-proxy package.

auto-apt-proxy is:

auto-apt-proxy installs itself as an APT proxy autodetector, and detects common setups by checking some hosts on the local network for well-known APT proxies such as apt-cacher-ng.

This package is most useful for development environments, and will Do The Right Thing for at least these cases:

  • Build chroots, with a proxy running on the host system.
  • Docker/lxc containers, with a proxy running on the host system.
  • Virtual machines with NAT networking, with a proxy running on the host system.
  • Any other system, with a proxy running on its default gateway.
  • Systems where the apt-proxy hostname resolves to a valid IP address and a supported proxy is detected at that address.

The following APT proxy servers are supported and automatically detected:

  • apt-cacher-ng
  • approx
  • apt-cacher
  • squid-deb-proxy
  • any proxy advertised by an _apt_proxy._tcp SRV record in your domain

This package has a minimal set of dependencies in order to minimize the influence on systems where it is installed.

This package does not query mDNS SRV records, which would require avahi. If you need that, consider the squid-deb-proxy-client package instead.

To fix this problem, we can install more using the command below.

sudo apt-get -y install auto-apt-proxy

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install auto-apt-proxy.

sudo apt -y install auto-apt-proxy

Or if you have aptitude installed you can use the following command.

sudo aptitude install auto-apt-proxy

Summary

In this tutorial we learn how to fix auto-apt-proxy command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.