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 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-16 17:13:35 +00:00
parent 78f81eeccd
commit c5aa382527
+13 -1
View File
@@ -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)"