Score:1

E: Unable to locate package mosquitto

cn flag

I'm trying to install the mosquitto package, but when I type sudo apt-get install mosquitto it returns E: Unable to locate package mosquitto.

I already ran sudo apt-get update and sudo apt-get upgrade.

Output from 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

(sorry for the german parts.) It seems like it's already installed? But when I run mosquitto_sub -d -t /home/data to test, I only get Error: Connection refused

Output from 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

Seems like there's a problem with 'apt-get update, so I tried fixing it with debsums, like in this thread, but apt-get update can't find the debsums package to install on the first hand...

cn flag
The output says that libmosquitto & the mosquitto clients are installed not the broker (they are 3 separate packages). Are there any errors in the `apt-get update` output (do they match the linked question)?
Score:2
in flag

Use apt-file or as alternative the online search to search for package names.

You will find that mosquitto is indeed the correct Debian package name to install the server part. The command mosquitto_sub is provided by package mosquitto-clients.

However, the sources.list provided indicates that your installation is not based on Debian but based on Raspberry Pi OS (previously called Raspbian) in version buster. The repository contains the packages as well.

Please check carefully your file sources.list. It seems that the repository is commented out. Remove the # in the first line eventually? The file should look similar as this:

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
Schneggl avatar
cn flag
Thank you! Editing ```sources.list``` worked. Tho I don't understand how that problem occured on the first hand...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.