Apt-Cacher detect script not working #1365

Closed
opened 2026-02-05 00:30:28 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @dbinit on GitHub (Jul 30, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

cloudflared, homebridge

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/homebridge.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📝 Provide a clear and concise description of the issue.

I've noticed in the last 2 scripts I've run/installed that I'm getting the following when running apt update in the LXC:

: forward host lookup failed: Unknown server error
: forward host lookup failed: Unknown server error

So I did some digging and found this:

root@homebridge:~# cat /etc/apt/apt.conf.d/00aptproxy 
Acquire::http::Proxy-Auto-Detect "/usr/local/bin/apt-proxy-detect.sh";

root@homebridge:~# cat /usr/local/bin/apt-proxy-detect.sh
#!/bin/bash
if nc -w1 -z "${CACHER_IP}" 3142; then
  echo -n "http://${CACHER_IP}:3142"
else
  echo -n "DIRECT"
fi

I don't have a $CACHER_IP environment variable set. Looking at the code, it would appear that the apt-cacher-ng IP address I had specified in the settings should have been embedded in the script. But this commit (8d91a5df5f) a month ago changed that.

I'm wondering what the issue is that the commit was supposed to fix. Could the commit be reverted? Or maybe the $CACHER_IP should have been added to my env vars somewhere? I'm having to manually update the apt-proxy-detect.sh script to add my cacher IP address.

Many thanks!

🔄 Steps to reproduce the issue.

  1. Install a script, e.g. cloudflared
  2. Choose Advanced Settings (not sure if apt cacher is an option with default settings)
  3. Specify an IP address for apt-cacher-ng
  4. After update, run apt update in LXC to see error above

Paste the full error output (if available).

see above

🖼️ Additional context (optional).

No response

Originally created by @dbinit on GitHub (Jul 30, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? cloudflared, homebridge ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/homebridge.sh)" ### ⚙️ What settings are you using? - [ ] Default Settings - [x] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📝 Provide a clear and concise description of the issue. I've noticed in the last 2 scripts I've run/installed that I'm getting the following when running `apt update` in the LXC: ``` : forward host lookup failed: Unknown server error : forward host lookup failed: Unknown server error ``` So I did some digging and found this: ``` root@homebridge:~# cat /etc/apt/apt.conf.d/00aptproxy Acquire::http::Proxy-Auto-Detect "/usr/local/bin/apt-proxy-detect.sh"; root@homebridge:~# cat /usr/local/bin/apt-proxy-detect.sh #!/bin/bash if nc -w1 -z "${CACHER_IP}" 3142; then echo -n "http://${CACHER_IP}:3142" else echo -n "DIRECT" fi ``` I don't have a $CACHER_IP environment variable set. Looking at the code, it would appear that the apt-cacher-ng IP address I had specified in the settings should have been embedded in the script. But this commit (https://github.com/community-scripts/ProxmoxVE/commit/8d91a5df5f68628b327d616294a5f26072b16775) a month ago changed that. I'm wondering what the issue is that the commit was supposed to fix. Could the commit be reverted? Or maybe the `$CACHER_IP` should have been added to my env vars somewhere? I'm having to manually update the apt-proxy-detect.sh script to add my cacher IP address. Many thanks! ### 🔄 Steps to reproduce the issue. 1. Install a script, e.g. cloudflared 2. Choose Advanced Settings (not sure if apt cacher is an option with default settings) 3. Specify an IP address for apt-cacher-ng 4. After update, run `apt update` in LXC to see error above ### ❌ Paste the full error output (if available). see above ### 🖼️ Additional context (optional). _No response_
OVERLORD added the bug label 2026-02-05 00:30:28 +03:00
Author
Owner

@MickLesk commented on GitHub (Jul 30, 2025):

the initial commit was after an big merge of some core things, it breaks all installs, so i added as qf another heredoc. Now it should be fixed with another variant

@MickLesk commented on GitHub (Jul 30, 2025): the initial commit was after an big merge of some core things, it breaks all installs, so i added as qf another heredoc. Now it should be fixed with another variant
Author
Owner

@dbinit commented on GitHub (Jul 30, 2025):

Appreciate the quick fix!

@dbinit commented on GitHub (Jul 30, 2025): Appreciate the quick fix!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#1365