apt-cacher command not found

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

Introduction

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

apt-cacher: command not found

or when using sudo you get the following error message

sudo: apt-cacher: command not found

Solutions to apt-cacher: command not found

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

In Ubuntu apt-cacher is provided by apt-cacher package.

apt-cacher is:

Apt-cacher performs caching of files requested by apt-get (or other APT clients such as aptitude or synaptic). Apt-cacher can also proxy Debian Bugs SOAP requests for apt-listbugs. It is most useful for local area networks with limited network bandwidth or to reduce multiple large downloads.

When a file or package is requested, apt-cacher checks whether it already has the requested version, in which case it fulfils the request immediately. If not, it downloads the package while streaming it to the client at the same time. A local copy is then kept for any subsequent requests.

Apt-cacher has been optimized for best utilization of network bandwidth and is efficient even on slow or low-memory servers. Multiple ways of installation are possible: as a stand-alone proxy, as a daemon executed by inetd or as a CGI program (deprecated). Client machines are configured by changing APT’s proxy configuration or modification of access URLs in sources.list.

The package includes utilities to clean the cache (removing obsolete package files), generate usage reports and import existing package files. Optional features include a file checksum verification framework, IPv6 support, FTP and HTTPS (proxying only) support as well as the simultaneous caching of repositories from different distributions.

Apt-cacher can be used as a replacement for apt-proxy, with no need to modify client’s /etc/apt/sources.list files (and even reusing its config and cached data), or as an alternative to approx.

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

sudo apt-get -y install apt-cacher

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

You can also use apt command to install apt-cacher.

sudo apt -y install apt-cacher

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

sudo aptitude install apt-cacher

Summary

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