How To Install apt-cacher-ng on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 454 words
Introduction
In this tutorial we learn how to install apt-cacher-ng
on Ubuntu.
What is apt-cacher-ng
apt-cacher-ng is:
Apt-Cacher NG is a caching proxy for downloading packages from Debian-style software repositories (or possibly from other types).
The main principle is that a central machine hosts the proxy for a local network, and clients configure their APT setup to download through it. Apt-Cacher NG keeps a copy of all useful data that passes through it, and when a similar request is made, the cached copy of the data is delivered without being re-downloaded.
Apt-Cacher NG has been designed from scratch as a replacement for apt-cacher, but with a focus on maximizing throughput with low system resource requirements. It can also be used as replacement for apt-proxy and approx with no need to modify clients’ sources.list files.
There are three methods to install apt-cacher-ng
on Ubuntu. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install apt-cacher-ng Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install apt-cacher-ng
using apt-get
by running the following command:
sudo apt-get -y install apt-cacher-ng
Install apt-cacher-ng Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install apt-cacher-ng
using apt
by running the following command:
sudo apt -y install apt-cacher-ng
Install apt-cacher-ng Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install apt-cacher-ng
using aptitude
by running the following command:
sudo aptitude -y install apt-cacher-ng
How To Uninstall apt-cacher-ng on Ubuntu
To uninstall only the apt-cacher-ng
package we can use the following command:
sudo apt-get remove apt-cacher-ng
Uninstall apt-cacher-ng And Its Dependencies
To uninstall apt-cacher-ng
and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove apt-cacher-ng
Remove apt-cacher-ng Configurations and Data
To remove apt-cacher-ng
configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge apt-cacher-ng
Remove apt-cacher-ng configuration, data, and all of its dependencies
We can use the following command to remove apt-cacher-ng
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge apt-cacher-ng
Dependencies
apt-cacher-ng have the following dependencies:
- dpkg
- libbz2-1.0
- libc-ares2
- libc6
- libevent-2.1-7
- libevent-pthreads-2.1-7
- libfuse2
- libgcc-s1
- liblzma5
- libssl3
- libstdc++6
- libsystemd0
- libwrap0
- zlib1g
References
Summary
In this tutorial we learn how to install apt-cacher-ng
package on Ubuntu using different package management tools: apt, apt-get and aptitude.