樹莓派4B安裝libbluetooth-dev報錯解決


直接apt-get安裝libbluetooth-dev時發生依賴錯誤:

pi@raspberrypi:~ $ sudo apt-get install libbluetooth-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libbluetooth-dev : Depends: libbluetooth3 (= 5.50-1.2~deb10u1) but 5.50-1.2~deb10u1+rpt1 is to be installed

並且-f和-m都無法繞過這類依賴錯誤。

實際上從名字猜測,因為5.50-1.2~deb10u1+rpt1和5.50-1.2~deb10u1看似非常接近,可能前者是專為raspberry發布的一個版本,因此我們考慮強行繞過依賴檢查。

樹莓派上繞過dependency檢查的一般套路是:

apt-get下載deb包

使用dpkg --force-depends-version忽略dependency錯誤。即:

pi@raspberrypi:~ $ apt-get download libbluetooth-dev
pi@raspberrypi:~ $ ll
total 244
drwxr-xr-x 2 pi   pi     4096 May 27 15:18 Bookshelf
drwxr-xr-x 6 pi   pi     4096 Jun 13 20:37 code
drwxr-xr-x 2 pi   pi     4096 Jun 13 20:19 Desktop
drwxr-xr-x 2 pi   pi     4096 May 27 15:46 Documents
drwxr-xr-x 2 pi   pi     4096 Jun 20 22:19 Downloads
-rw-r--r-- 1 root root 190008 Mar 27 18:08 libbluetooth-dev_5.50-1.2~deb10u1_armhf.deb
drwxr-xr-x 2 pi   pi     4096 May 27 15:46 Music
drwxr-xr-x 2 pi   pi     4096 May 27 15:46 Pictures
drwxr-xr-x 2 pi   pi     4096 May 27 15:46 Public
drwxr-xr-x 2 pi   pi     4096 May 27 15:46 Templates
drwxr-xr-x 2 pi   pi     4096 Jun 13 20:14 Videos
pi@raspberrypi:~ $ sudo dpkg -i --force-depends-version ./libbluetooth-dev_5.50-1.2~deb10u1_armhf.deb
(Reading database ... 158172 files and directories currently installed.)
Preparing to unpack .../libbluetooth-dev_5.50-1.2~deb10u1_armhf.deb ...
Unpacking libbluetooth-dev:armhf (5.50-1.2~deb10u1) over (5.50-1.2~deb10u1) ...
dpkg: libbluetooth-dev:armhf: dependency problems, but configuring anyway as you requested:
 libbluetooth-dev:armhf depends on libbluetooth3 (= 5.50-1.2~deb10u1); however:
  Version of libbluetooth3:armhf on system is 5.50-1.2~deb10u1+rpt1.

Setting up libbluetooth-dev:armhf (5.50-1.2~deb10u1) ...

然后檢查安裝成功:

pi@raspberrypi:~ $ dpkg -l|grep bluetoo
ii  libbluetooth-dev:armhf                5.50-1.2~deb10u1                       armhf        Development files for using the BlueZ Linux Bluetooth library
ii  libbluetooth3:armhf                   5.50-1.2~deb10u1+rpt1                  armhf        Library to use the BlueZ Linux Bluetooth stack
ii  lxplug-bluetooth                      0.13                                   armhf        Bluetooth plugin for lxpanel
ii  pi-bluetooth                          0.1.13                                 all          Raspberry Pi 3 bluetooth

pi@raspberrypi:~ $ find /usr/ -name "bluetooth.h"
/usr/include/bluetooth/bluetooth.h

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM