From c3a5abfa0b7eaf044bac41cfa6997538c79fc5f0 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Sun, 3 May 2026 21:04:22 +0200 Subject: [PATCH] fix(pbs/pve): guard sed against missing /etc/apt/sources.list PBS 4.x and fresh PVE 9 / Trixie installs no longer ship /etc/apt/sources.list (deb822 only). Running 'sed -i ... /etc/apt/sources.list || true' suppresses the exit code but still prints the noisy stderr message 'sed: can't read /etc/apt/sources.list: No such file or directory' during the post-install routine. Wrap the call with an existence check so the sed step is skipped cleanly when the legacy file is absent. Fixes #14174 --- tools/pve/pbs4-upgrade.sh | 4 +++- tools/pve/post-pbs-install.sh | 4 +++- tools/pve/post-pve-install.sh | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/pve/pbs4-upgrade.sh b/tools/pve/pbs4-upgrade.sh index 2a2fa59fd..a05ba8bb9 100644 --- a/tools/pve/pbs4-upgrade.sh +++ b/tools/pve/pbs4-upgrade.sh @@ -57,7 +57,9 @@ start_routines() { yes) msg_info "Switching to Debian 13 (Trixie) Sources" rm -f /etc/apt/sources.list.d/*.list - sed -i '/proxmox/d;/bookworm/d' /etc/apt/sources.list || true + if [ -f /etc/apt/sources.list ]; then + sed -i '/proxmox/d;/bookworm/d' /etc/apt/sources.list + fi cat >/etc/apt/sources.list.d/debian.sources </etc/apt/sources.list.d/debian.sources </etc/apt/sources.list.d/debian.sources <