Fix InfluxDB APT key: add fallback sources and trusted=yes (#119)

* Fix InfluxDB APT key: add fallback sources and trusted=yes fallback

The key URL at repos.influxdata.com/influxdata-archive.key is intermittently
down. Add keyserver.ubuntu.com as fallback source. Use trusted=yes as last
resort if key fetch fails. Also correct keyring path to /usr/share/keyrings/
and remove Bookworm-specific comment.

* Fix shellcheck issues: remove duplicate shebang, fix cd error handling

---------

Co-authored-by: Jarvis <jarvis@wickedyoda.local>
This commit is contained in:
WickedYodaandJarvis authored and GitHub committed 2026-09-14 11:39:21 -05:00
1 parent 60eb87ce59
commit bcbe8b1d40
2 files changed
+23 -10

No files matched your search

+2 -3
View File
@@ -1,5 +1,4 @@
#!/bin/bash
!/bin/bash
# ----------------------------------------------------------------------
# | Add repos |
@@ -46,8 +45,8 @@ sudo apt-get -y install
# | Install Discord |
# ----------------------------------------------------------------------
cd /home/traver/Downloads
wget -O discord-0.0.1.deb https://discordapp.com/api/download?platform=linux&format=deb
cd /home/traver/Downloads || exit
wget -O discord-0.0.1.deb 'https://discordapp.com/api/download?platform=linux&format=deb'
sudo dpkg -i discord-0.0.1.deb
+21 -7
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
echo "==> Fixing APT repository keys and stale indexes on Debian Bookworm"
echo "==> Fixing APT repository keys and stale indexes"
# Make sure basic tools exist
sudo apt-get update
@@ -11,16 +11,30 @@ sudo apt-get install -y ca-certificates curl gpg
sudo mkdir -p /etc/apt/keyrings
echo "==> Fixing InfluxData repo key"
curl --silent --location -o /tmp/influxdata-archive.key https://repos.influxdata.com/influxdata-archive.key
sudo mkdir -p /usr/share/keyrings
# The InfluxData Archive Key URL is intermittently down; try multiple sources
# Primary: influxdata-archive.key, Fallback: Ubuntu keyserver
curl --silent --location --fail --max-time 10 -o /tmp/influxdata-archive.key \
https://repos.influxdata.com/influxdata-archive.key 2>/dev/null || \
curl --silent --max-time 10 -o /tmp/influxdata-archive.key \
"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x24C975CBA61A024EE1B631787C3D57159FC2F927" || \
{ echo "WARNING: Could not fetch InfluxData key from any source"; }
# Verify official InfluxData fingerprint before installing key
if [ -s /tmp/influxdata-archive.key ]; then
gpg --show-keys --with-fingerprint --with-colons /tmp/influxdata-archive.key 2>&1 \
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$'
gpg --dearmor < /tmp/influxdata-archive.key | sudo tee /etc/apt/keyrings/influxdata-archive.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main" \
| grep -q 'fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927' || {
echo "WARNING: Key fingerprint mismatch — key may be compromised"
}
gpg --dearmor < /tmp/influxdata-archive.key | sudo tee /usr/share/keyrings/influxdata-archive.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main" \
| sudo tee /etc/apt/sources.list.d/influxdata.list >/dev/null
else
# Fallback: use trusted=yes (signature verification disabled)
echo "deb [trusted=yes] https://repos.influxdata.com/debian stable main" \
| sudo tee /etc/apt/sources.list.d/influxdata.list >/dev/null
fi
echo "==> Fixing Sury PHP repo key"
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb