• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Set up APT-Caching Server Using Apt-Cacher NG on Debian 11.3

  • 01:00 lsb_release -a
  • 01:15 apt-get update -y
  • 01:46 sudo apt-get install apt-cacher-ng -y
  • 02:30 systemctl start apt-cacher-ng
  • 02:50 systemctl enable apt-cacher-ng
  • 03:15 systemctl status apt-cacher-ng
  • 03:47 ss -altnp | grep apt
  • 04:17 nano /etc/apt-cacher-ng/acng.conf
  • 04:55 systemctl restart apt-cacher-ng
  • 05:34 nano /etc/apt/apt.conf.d/00aptproxy
  • 06:50 apt-get install apache2 -y
  • 06:56 systemctl status apache2
{{postValue.id}}

To Set Up APT-Caching Server Using Apt-Cacher NG On Debian 11.3

Introduction:

Apt-Cacher-NG is a caching proxy server (or apt proxy) for Debian-based distributions including Ubuntu, Kubuntu, Xubuntu, Edubuntu, Linux Mint, etc, which is used to cache the downloaded packages locally on your server.

Installation Procedure:

Step 1: Check the installed OS version by using the below command

root@linuxhelp: ~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11

Step 2: Next update the apt repository by using the below command

root@linuxhelp:~# apt-get update -y
Get:1 http://security.debian.org/debian-security bullseye-security InRelease [48.4 kB]            
Hit:2 http://repo.mysql.com/apt/debian bullseye InRelease                                         
Hit:3 http://deb.debian.org/debian bullseye InRelease                                             
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Hit:5 https://packages.sury.org/php bullseye InRelease    
Get:6 http://security.debian.org/debian-security bullseye-security/main Sources [152 kB]
Get:7 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [183 kB]
Fetched 383 kB in 11s (34.5 kB/s)                  
Reading package lists... Done.

Step 3: Install Apt-Cacher-NG by using the below command

root@linuxhelp:~# sudo apt-get install apt-cacher-ng -y

Step 4: Once the Apt-Cacher-NG package is installed, start the Apt-Cacher-NG service and enable it to start at system reboot.

root@linuxhelp:~# systemctl start apt-cacher-ng
root@linuxhelp:~# systemctl enable apt-cacher-ng
Synchronizing state of apt-cacher-ng.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apt-cacher-ng

Step 5: Now check the status of Apt-cacher-NG by using the below command

root@linuxhelp:~# systemctl status apt-cacher-ng
● apt-cacher-ng.service - Apt-Cacher NG software download proxy
     Loaded: loaded (/lib/systemd/system/apt-cacher-ng.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-09-15 23:28:10 IST; 4min 49s ago
   Main PID: 64366 (apt-cacher-ng)
      Tasks: 1 (limit: 3450)
     Memory: 2.1M
        CPU: 18ms
     CGroup: /system.slice/apt-cacher-ng.service
             └─64366 /usr/sbin/apt-cacher-ng -c /etc/apt-cacher-ng ForeGround=1

Sep 15 23:28:10 linuxhelp systemd[1]: Starting Apt-Cacher NG software download proxy...
Sep 15 23:28:10 linuxhelp systemd[1]: Started Apt-Cacher NG software download proxy.

Step 6: By default, Apt-Cacher-NG listens on port 3142. Now check by using the below command

root@linuxhelp:~# ss -altnp | grep apt
LISTEN 0      250          0.0.0.0:3142       0.0.0.0:*    users:(("apt-cacher-ng",pid=64366,fd=10))
LISTEN 0      250             [::]:3142          [::]:*    users:(("apt-cacher-ng",pid=64366,fd=11))

Step 7: By default, Apt-Cacher NG does not serve HTTPS repositories, so you will need to enable it. Open and edit the Apt-Cacher-NG default configuration file.

root@linuxhelp:~# nano /etc/apt-cacher-ng/acng.conf

snap 1

Step 8: Now restart the Apt-Cacher-NG by using the below command

root@linuxhelp:~# systemctl restart apt-cacher-ng

Step 9: Configure Client System to use Apt-Cacher NG. Create a new proxy configuration file.

Add the following Lines:
Acquire::http::Proxy "http://your-server-ip:3142";
root@linuxhelp:~# nano /etc/apt/apt.conf.d/00aptproxy

snap 2

Step 10: Now, let’s try to install the Apache package on the Client system by using the below command:

root@linuxhelp:~# apt-get install apache2 -y
root@linuxhelp:~# systemctl status apache2

Step 11: Apt-Cache NG also provides a web-based interface to display all reports.so go to browser browse the URL or Ip address as shown in the below image. http://your-server-ip:3142/acng-report.html. snap 3

Step 12: This is the dashboard for Apt-Cacher NG maintenance page. snap 4

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Set up APT-Caching Server Using Apt-Cacher NG on Debian 11.3. Your feedback is much welcome.

Tags:
muhammad
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is an APT-Caching Server?

A

Apt-Cacher-NG is a caching proxy server (or apt proxy) for Debian-based distributions like Ubuntu, Kubuntu, Xubuntu, Edubuntu, Linux Mint, etc, which is used to cache the downloaded packages locally on your server.

Q

What is an APT update cache?

A

The apt-cache command can display much of the information stored in APT's internal database.

Q

What is the APT-Caching Server port number?

A

By default, port number 3142

Q

How do I clear the apt-get cache?

A

The clean command clears out the local repository of downloaded package files.

Q

How to restart APT-Caching Server?

A

Restart the apt-caching server using the command for systemctl restart apt-cacher-ng.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.