Files
ProxmoxVE/install/apt-cacher-ng-install.sh
CanbiZ (MickLesk) 92d33ee5e9 feat(apt-cacher-ng): add avahi-daemon for mDNS service discovery (#11140)
apt-cacher-ng ships with Avahi service config but needs avahi-daemon
to advertise itself via mDNS for auto-apt-proxy discovery.

Closes #11101
2026-01-25 08:10:51 +01:00

28 lines
810 B
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2026 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://wiki.debian.org/AptCacherNg
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Apt-Cacher NG"
DEBIAN_FRONTEND=noninteractive $STD apt -o Dpkg::Options::="--force-confold" install -y apt-cacher-ng avahi-daemon
sed -i 's/# PassThroughPattern: .* # this would allow CONNECT to everything/PassThroughPattern: .*/' /etc/apt-cacher-ng/acng.conf
cat <<EOF >/etc/apt/apt.conf.d/00aptproxy.conf
Acquire::http::Proxy "http://localhost:3142";
EOF
systemctl enable -q --now apt-cacher-ng
msg_ok "Installed Apt-Cacher NG"
motd_ssh
customize
cleanup_lxc