From 9afff0f4b2f7f922e25072fb0e5cb6ea19baf614 Mon Sep 17 00:00:00 2001 From: Smittix Date: Wed, 18 Feb 2026 16:55:30 +0000 Subject: [PATCH] fix: Remove librtlsdr0 apt package when installing Blog drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removing only the rtl-sdr binary package left librtlsdr0 (the library) installed at /lib/aarch64-linux-gnu/librtlsdr.so.0. ldconfig lists the multiarch path before /usr/local/lib, so even the Blog driver binary (/usr/local/bin/rtl_test) was loading the old apt library — which has no R828D/V4 tuner support — causing the PLL-not-locked / deaf dongle symptom. Now remove rtl-sdr, librtlsdr0, and librtlsdr-dev together so the only librtlsdr.so.0 in the ldconfig cache is the Blog drivers' copy in /usr/local/lib. Co-Authored-By: Claude Sonnet 4.6 --- setup.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index a3ab0f6..340d846 100755 --- a/setup.sh +++ b/setup.sh @@ -1315,13 +1315,19 @@ install_rtlsdr_blog_drivers_debian() { $SUDO udevadm trigger || true fi - # Remove the apt rtl-sdr package to prevent binary/library conflicts. - # The apt package installs to /usr/bin and /usr/lib; keeping it alongside - # the Blog drivers (in /usr/local) causes ambiguity and can silently - # result in the wrong (non-V4-aware) library being loaded. - if dpkg -l rtl-sdr 2>/dev/null | grep -q "^ii"; then - info "Removing apt rtl-sdr package to prevent library conflicts with Blog drivers..." - $SUDO apt-get remove -y rtl-sdr >/dev/null 2>&1 || true + # Remove ALL apt rtl-sdr packages (binaries AND library) so nothing + # shadows /usr/local/lib/librtlsdr.so.0 from the Blog drivers. + # Removing only rtl-sdr leaves librtlsdr0 installed; ldconfig then + # picks /lib/aarch64-linux-gnu/librtlsdr.so.0 (apt, no R828D support) + # over /usr/local/lib/librtlsdr.so.0 (Blog drivers) because the + # multiarch path is searched first. + local pkgs_to_remove=() + for pkg in rtl-sdr librtlsdr0 librtlsdr-dev; do + dpkg -l "$pkg" 2>/dev/null | grep -q "^ii" && pkgs_to_remove+=("$pkg") + done + if [[ ${#pkgs_to_remove[@]} -gt 0 ]]; then + info "Removing apt rtl-sdr packages to prevent library conflicts: ${pkgs_to_remove[*]}" + $SUDO apt-get remove -y "${pkgs_to_remove[@]}" >/dev/null 2>&1 || true fi $SUDO ldconfig