Apt-Cacher NG
Opening Disclaimers
Proxmox
This Guide is written based on the use of Proxmox-VE version 7.0 and more specifically Proxmox_LXC. These instructions should be adaptable to other situations.
Container Creation
General
- Unpriviliged container: checked
- Nesting: unchecked
Template
- Template: ubuntu-21.04-standard_21.04-1_amd64
Disks
- Disk Size (GiB): 4
CPU
Cores: 1
Memory
- Memory (MiB): 256
- Swap (MiB): 512
Network
- IPv4 Static
- IPv4 Gateway
DNS
- DNS Servers: 8.8.8.8 (Change to 127.0.0.1 post-install)
Confirm
- Start After Created: unchecked
Container Tweaks
Options
- Start at boot: yes
Container First Run Steps
Run Updates
apt update && apt full-upgrade -y
Add a sudo user
adduser sysop usermod -aG sudo sysop
Cleanup The Container for some easy space savings.
apt autoremove -y && apt clean -y
Apt-Cacher NG Installation
apt-get install apt-cacher-ng
Client Config
echo 'Acquire::http { Proxy "http://proxy:3142"; }' | sudo tee -a /etc/apt/apt.conf.d/00proxy
OR
nano /etc/apt/apt.conf.d/00proxy
Acquire {
HTTP::proxy "http://proxy_server:port/";
HTTPS::proxy "http://proxy_server:port/";
}
Tweaks
nano /etc/apt-cacher-ng/acng.conf
add to the bottom
PassThroughPattern: .*
Find this section and tweak:
# Repository remapping. See manual for details. # In this example, some backends files might be generated during package # installation using information collected on the system. # Examples: Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives Remap-uburepsec: security.ubuntu.com /uburepsec ; file:backends_ubuntu Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here Remap-sfnet: file:sfnet_mirrors # ; file:backends_sfnet # incomplete, please create this file or specify preferred mirrors here Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux Remap-fedora: file:fedora_mirrors # Fedora Linux Remap-epel: file:epel_mirrors # Fedora EPEL Remap-slrep: file:sl_mirrors # Scientific Linux Remap-gentoo: file:gentoo_mirrors.gz /gentoo ; file:backends_gentoo # Gentoo Archives Remap-openjdk: file:openjdk /openjdk ; file:openjdk
Create this file if not there
nano /etc/apt-cacher-ng/sfnet_mirrors
http://biznetnetworks.dl.sourceforge.net/project/ http://cdnetworks-us-1.dl.sourceforge.net/project/ http://citylan.dl.sourceforge.net/project/ http://dfn.dl.sourceforge.net/project/ http://fastbull.dl.sourceforge.net/project/ http://freefr.dl.sourceforge.net/project/ http://garr.dl.sourceforge.net/project/ http://heanet.dl.sourceforge.net/project/ http://hivelocity.dl.sourceforge.net/project/ http://ignum.dl.sourceforge.net/project/ http://internode.dl.sourceforge.net/project/ http://iweb.dl.sourceforge.net/project/ http://jaist.dl.sourceforge.net/project/ http://kent.dl.sourceforge.net/project/ http://mesh.dl.sourceforge.net/project/ http://nchc.dl.sourceforge.net/project/ http://ncu.dl.sourceforge.net/project/ http://netcologne.dl.sourceforge.net/project/ http://ovh.dl.sourceforge.net/project/ http://puzzle.dl.sourceforge.net/project/ http://softlayer.dl.sourceforge.net/project/ http://space.dl.sourceforge.net/project/ http://sunet.dl.sourceforge.net/project/ http://superb-east,.dl.sourceforge.net/project/ http://surfnet.dl.sourceforge.net/project/ http://switch.dl.sourceforge.net/project/ http://transact.dl.sourceforge.net/project/ http://ufpr.dl.sourceforge.net/project/ http://voxel.dl.sourceforge.net/project/ http://waix.dl.sourceforge.net/project/