From c5aa382527524c45274bdc4c7515c84b4113c014 Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 16 Jan 2026 17:13:35 +0000 Subject: [PATCH] Improve RTL-SDR package conflict handling Fix broken package states by: - Running apt --fix-broken install before attempting installation - Removing both librtlsdr2 and rtl-sdr when conflict detected - Cleaning up with autoremove - Running dpkg --configure -a to fix partial installations Co-Authored-By: Claude Sonnet 4.5 --- setup.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 1bac7e5..ae8ad01 100755 --- a/setup.sh +++ b/setup.sh @@ -555,10 +555,22 @@ install_debian_packages() { progress "Installing RTL-SDR" # Handle package conflict between librtlsdr0 and librtlsdr2 + # First fix any broken package state + if ! dpkg -l | grep -q "^ii.*rtl-sdr"; then + info "Attempting to fix broken package state..." + $SUDO apt-get --fix-broken install -y >/dev/null 2>&1 || true + fi + + # Remove conflicting packages if dpkg -l | grep -q librtlsdr2; then info "Removing conflicting librtlsdr2 package..." - $SUDO apt-get remove -y librtlsdr2 >/dev/null 2>&1 || true + $SUDO apt-get remove -y librtlsdr2 rtl-sdr >/dev/null 2>&1 || true + $SUDO apt-get autoremove -y >/dev/null 2>&1 || true fi + + # Clean up any partial installations + $SUDO dpkg --configure -a >/dev/null 2>&1 || true + apt_install rtl-sdr progress "Installing RTL-SDR Blog drivers (V4 support)"