fix: Remove librtlsdr0 apt package when installing Blog drivers

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 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-18 16:55:30 +00:00
parent 5a7a6ce522
commit 9afff0f4b2
+13 -7
View File
@@ -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