
我正在嘗試安裝 mosquitto 軟體包,但是當我輸入時,sudo apt-get install mosquitto
它會返回E: Unable to locate package mosquitto
.
我已經跑了sudo apt-get update
並且sudo apt-get upgrade
.
輸出來自apt search mosquitto
:
Sortierung... Fertig
Volltextsuche... Fertig
libmosquitto1/now 1.5.7-1+deb10u1 armhf [Installiert,lokal]
MQTT version 3.1/3.1.1 client library
mosquitto-clients/now 1.5.7-1+deb10u1 armhf [Installiert,lokal]
Mosquitto command line MQTT clients
(抱歉德國零件。)看起來已經安裝了?但是當我運行mosquitto_sub -d -t /home/data
測試時,我只得到Error: Connection refused
輸出來自cat /etc/apt/sources.list
:
#deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
似乎 ' 有問題apt-get update
,所以我嘗試用 修復它debsums
,例如這線程,但apt-get update
無法找到要安裝的第一手 debsums 包...
答案1
你會發現蚊子確實是正確的Debian 軟體包名稱安裝伺服器部分。該命令mosquitto_sub
由套件提供蚊子客戶。
但是,sources.list
提供的資訊表明您的安裝不是基於 Debian,而是基於 Raspberry Pi OS(以前稱為 Raspbian)版本buster
。儲存庫包含包以及。
請仔細檢查您的文件sources.list
。看來存儲庫已被註解掉。最終刪除#
第一行中的 嗎?該文件應如下所示:
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://archive.raspberrypi.org/debian/ buster main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi