Pages

2018/11/11

Raspbian - Upgrading MQTT from Jessie to Stretch and testing the upgraded MQTT

This post deals with how to upgrade MQTT from Raspbian Jessie to Raspbian Stretch and testing the upgraded MQTT.

When message similar to the one shown below appears after upgrading from Raspbian Jessie to Stretch it means you need to manually upgrade MQTT.

pi@raspberrypi:~ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Get:2 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Hit:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Ign:2 http://repo.mosquitto.org/debian stretch InRelease
Fetched 11.0 kB in 5s (1,965 B/s)
Reading package lists... Done
W: GPG error: http://repo.mosquitto.org/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 61611AE430993623 Mosquitto Apt Repository <repo@mosquitto.org>
W: The repository 'http://repo.mosquitto.org/debian stretch InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
pi@raspberrypi:~ $


With reference to the info. at https://mosquitto.org/blog/2018/01/mosquitto-debian-repo-key-updated/


The problem could be solved by the issuing the following commands.

sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key

pi@raspberrypi:~ $ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
--2018-11-07 18:39:10--  http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3120 (3.0K) [application/octet-stream]
Saving to: ‘mosquitto-repo.gpg.key.3’

mosquitto-repo.gpg.key.3 100%[================================>]   3.05K  --.-KB/s    in 0.001s

2018-11-07 18:39:11 (2.97 MB/s) - ‘mosquitto-repo.gpg.key.3’ saved [3120/3120]

pi@raspberrypi:~ $ sudo apt-key add mosquitto-repo.gpg.key
OK
pi@raspberrypi:~ $

Do "sudo apt-get update" again to check the result.

pi@raspberrypi:~ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Get:2 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Hit:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Ign:2 http://repo.mosquitto.org/debian stretch InRelease
Fetched 11.0 kB in 5s (1,871 B/s)
Reading package lists... Done
W: GPG error: http://repo.mosquitto.org/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 61611AE430993623 Mosquitto Apt Repository <repo@mosquitto.org>
W: The repository 'http://repo.mosquitto.org/debian stretch InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
pi@raspberrypi:~ $

Hum~~ The problem still exists..

Restart the system by issuing "sudo reboot".

========================================================================

After googling a while, I came across the below links which contain solution to the above problem.

Raspbian Stretch install error #529
https://github.com/eclipse/mosquitto/issues/529

How to upgrade Mosquitto MQTT to the latest version?
https://raspberrypi.stackexchange.com/questions/80051/how-to-upgrade-mosquitto-mqtt-to-the-latest-version

Below is a quick write up of my experiment following the info. from the 2 links above.

To use the new repository you should first import the repository package signing key:

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key

pi@raspberrypi:~ $ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
--2018-11-11 14:53:17--  http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3120 (3.0K) [application/octet-stream]
Saving to: ‘mosquitto-repo.gpg.key.4’

mosquitto-repo.gpg.key. 100%[=============================>]   3.05K  --.-KB/s    in 0s

2018-11-11 14:53:18 (20.0 MB/s) - ‘mosquitto-repo.gpg.key.4’ saved [3120/3120]

pi@raspberrypi:~ $ sudo apt-key add mosquitto-repo.gpg.key
OK

Then make the repository available to apt:

cd /etc/apt/sources.list.d/

Then one of the following, depending on which version of debian you are using:

sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list

pi@raspberrypi:~ $ cd /etc/apt/sources.list.d/
pi@raspberrypi:/etc/apt/sources.list.d $ sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
--2018-11-11 14:54:21--  http://repo.mosquitto.org/debian/mosquitto-stretch.list
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51 [application/octet-stream]
Saving to: ‘mosquitto-stretch.list’

mosquitto-stretch.list  100%[=============================>]      51  --.-KB/s    in 0s

2018-11-11 14:54:22 (541 KB/s) - ‘mosquitto-stretch.list’ saved [51/51]

pi@raspberrypi:/etc/apt/sources.list.d $

Then update apt information:

sudo apt-get update

pi@raspberrypi:/etc/apt/sources.list.d $ sudo apt-get update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]
Get:2 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease [15.0 kB]
Ign:2 http://repo.mosquitto.org/debian stretch InRelease
Get:4 http://repo.mosquitto.org/debian stretch/main all Packages [1,150 B]
Get:5 http://repo.mosquitto.org/debian stretch/main armhf Packages [7,191 B]
Get:6 http://archive.raspberrypi.org/debian stretch/main armhf Packages [181 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages [11.7 MB]
Fetched 11.9 MB in 40s (296 kB/s)
Reading package lists... Done
W: GPG error: http://repo.mosquitto.org/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 61611AE430993623 Mosquitto Apt Repository <repo@mosquitto.org>
W: The repository 'http://repo.mosquitto.org/debian stretch InRelease' is not signed.         
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.          
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
pi@raspberrypi:/etc/apt/sources.list.d $

And discover what mosquitto packages are available:

sudo apt-cache search mosquitto

Or just install or upgrade:

sudo apt-get install mosquitto

pi@raspberrypi:/etc/apt/sources.list.d $ sudo apt-get install mosquitto
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libasound2-dev libasyncns0 libcaca-dev libcaca0 libdrm-amdgpu1 libdrm-dev libdrm-exynos1 libdrm-freedreno1 libdrm-nouveau2
  libdrm-omap1 libdrm-radeon1 libdrm-tegra0 libflac8 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa
  libglib2.0-bin libglib2.0-dev libglu1-mesa libglu1-mesa-dev libh323-1.24.0v5 libice6 libllvm3.9 libodbc1 libogg0 libpcre3-dev
  libpcre32-3 libpcrecpp0v5 libpng-dev libpng-tools libpt2.10.11 libpthread-stubs0-dev libpulse-dev libpulse-mainloop-glib0
  libpulse0 libsasl2-dev libsdl1.2-dev libsdl1.2debian libsensors4 libslang2-dev libsm6 libsndfile1 libtxc-dxtn-s2tc libvorbis0a
  libvorbisenc2 libx11-dev libx11-doc libx11-xcb-dev libx11-xcb1 libxau-dev libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0
  libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0
  libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xfixes0 libxcb-xfixes0-dev libxcb1-dev
  libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxfixes3 libxi6 libxshmfence-dev libxshmfence1 libxtst6
  libxxf86vm-dev libxxf86vm1 mesa-common-dev odbcinst odbcinst1debian2 unixodbc-dev x11-common x11proto-core-dev
  x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev
  x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libev4 libuv1 libwebsockets8
Suggested packages:
  apparmor
The following NEW packages will be installed:
  libev4 libuv1 libwebsockets8 mosquitto
0 upgraded, 4 newly installed, 0 to remove and 5 not upgraded.
Need to get 86.3 kB/342 kB of archives.
After this operation, 766 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
  mosquitto
Install these packages without verification? [y/N] y
Get:1 http://archive.raspberrypi.org/debian stretch/main armhf libuv1 armhf 1.18.0-3~bpo9+1 [86.3 kB]
Fetched 86.3 kB in 1s (74.9 kB/s)
Selecting previously unselected package libev4.
(Reading database ... 48631 files and directories currently installed.)
Preparing to unpack .../libev4_1%3a4.22-1_armhf.deb ...
Unpacking libev4 (1:4.22-1) ...
Selecting previously unselected package libuv1:armhf.
Preparing to unpack .../libuv1_1.18.0-3~bpo9+1_armhf.deb ...
Unpacking libuv1:armhf (1.18.0-3~bpo9+1) ...
Selecting previously unselected package libwebsockets8:armhf.
Preparing to unpack .../libwebsockets8_2.0.3-2+b1~rpt1_armhf.deb ...
Unpacking libwebsockets8:armhf (2.0.3-2+b1~rpt1) ...
Selecting previously unselected package mosquitto.
Preparing to unpack .../mosquitto_1.5.3-0mosquitto1_armhf.deb ...
Unpacking mosquitto (1.5.3-0mosquitto1) ...
Setting up libev4 (1:4.22-1) ...
Setting up libuv1:armhf (1.18.0-3~bpo9+1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libwebsockets8:armhf (2.0.3-2+b1~rpt1) ...
Setting up mosquitto (1.5.3-0mosquitto1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u4) ...
pi@raspberrypi:/etc/apt/sources.list.d $

Finally install the Mosquitto Clients:

sudo apt-get install mosquitto-clients

pi@raspberrypi:/etc/apt/sources.list.d $ sudo apt-get install mosquitto-clients
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libasound2-dev libasyncns0 libcaca-dev libcaca0 libdrm-amdgpu1 libdrm-dev libdrm-exynos1 libdrm-freedreno1 libdrm-nouveau2
  libdrm-omap1 libdrm-radeon1 libdrm-tegra0 libflac8 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib2.0-bin
  libglib2.0-dev libglu1-mesa libglu1-mesa-dev libh323-1.24.0v5 libice6 libllvm3.9 libodbc1 libogg0 libpcre3-dev libpcre32-3
  libpcrecpp0v5 libpng-dev libpng-tools libpt2.10.11 libpthread-stubs0-dev libpulse-dev libpulse-mainloop-glib0 libpulse0
  libsasl2-dev libsdl1.2-dev libsdl1.2debian libsensors4 libslang2-dev libsm6 libsndfile1 libtxc-dxtn-s2tc libvorbis0a
  libvorbisenc2 libx11-dev libx11-doc libx11-xcb-dev libx11-xcb1 libxau-dev libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0
  libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0
  libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xfixes0 libxcb-xfixes0-dev libxcb1-dev
  libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxfixes3 libxi6 libxshmfence-dev libxshmfence1 libxtst6
  libxxf86vm-dev libxxf86vm1 mesa-common-dev odbcinst odbcinst1debian2 unixodbc-dev x11-common x11proto-core-dev
  x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev
  x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  mosquitto-clients
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 62.9 kB of archives.
After this operation, 137 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  mosquitto-clients
Install these packages without verification? [y/N] y
Get:1 http://repo.mosquitto.org/debian stretch/main armhf mosquitto-clients armhf 1.5.3-0mosquitto1 [62.9 kB]
Fetched 62.9 kB in 1s (49.3 kB/s)
Selecting previously unselected package mosquitto-clients.
(Reading database ... 48679 files and directories currently installed.)
Preparing to unpack .../mosquitto-clients_1.5.3-0mosquitto1_armhf.deb ...
Unpacking mosquitto-clients (1.5.3-0mosquitto1) ...
Setting up mosquitto-clients (1.5.3-0mosquitto1) ...
Processing triggers for man-db (2.7.6.1-2) ...
pi@raspberrypi:/etc/apt/sources.list.d $

Remove the packages that are no longer required.

sudo apt autoremove

pi@raspberrypi:/etc/apt/sources.list.d $ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libasound2-dev libasyncns0 libcaca-dev libcaca0 libdrm-amdgpu1 libdrm-dev libdrm-exynos1 libdrm-freedreno1 libdrm-nouveau2
  libdrm-omap1 libdrm-radeon1 libdrm-tegra0 libflac8 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib2.0-bin
  libglib2.0-dev libglu1-mesa libglu1-mesa-dev libh323-1.24.0v5 libice6 libllvm3.9 libodbc1 libogg0 libpcre3-dev libpcre32-3
  libpcrecpp0v5 libpng-dev libpng-tools libpt2.10.11 libpthread-stubs0-dev libpulse-dev libpulse-mainloop-glib0 libpulse0
  libsasl2-dev libsdl1.2-dev libsdl1.2debian libsensors4 libslang2-dev libsm6 libsndfile1 libtxc-dxtn-s2tc libvorbis0a
  libvorbisenc2 libx11-dev libx11-doc libx11-xcb-dev libx11-xcb1 libxau-dev libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0
  libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0
  libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xfixes0 libxcb-xfixes0-dev libxcb1-dev
  libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxfixes3 libxi6 libxshmfence-dev libxshmfence1 libxtst6
  libxxf86vm-dev libxxf86vm1 mesa-common-dev odbcinst odbcinst1debian2 unixodbc-dev x11-common x11proto-core-dev
  x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev
  x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
0 upgraded, 0 newly installed, 98 to remove and 5 not upgraded.
After this operation, 223 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 48687 files and directories currently installed.)
Removing libsdl1.2-dev (1.2.15+dfsg1-4) ...
Removing libasound2-dev:armhf (1.1.3-5+rpi3) ...
Removing libpulse-dev:armhf (10.0-1+deb9u1) ...
Removing libh323-1.24.0v5 (1.24.0~dfsg2-1.3) ...
Removing libpt2.10.11 (2.10.11~dfsg-2.1) ...
Removing libsdl1.2debian:armhf (1.2.15+dfsg1-4) ...
Removing libcaca-dev (0.99.beta19-2) ...
Removing libcaca0:armhf (0.99.beta19-2) ...
Removing libgl1-mesa-dri:armhf (13.0.6-1+rpi2) ...
Removing libglu1-mesa-dev:armhf (9.0.0-2.1) ...
Removing libgl1-mesa-dev:armhf (13.0.6-1+rpi2) ...
Removing mesa-common-dev:armhf (13.0.6-1+rpi2) ...
Removing libdrm-dev:armhf (2.4.74-1) ...
Removing libdrm-amdgpu1:armhf (2.4.74-1) ...
Removing libdrm-exynos1:armhf (2.4.74-1) ...
Removing libdrm-freedreno1:armhf (2.4.74-1) ...
Removing libdrm-nouveau2:armhf (2.4.74-1) ...
Removing libdrm-omap1:armhf (2.4.74-1) ...
Removing libdrm-radeon1:armhf (2.4.74-1) ...
Removing libdrm-tegra0:armhf (2.4.74-1) ...
Removing libglu1-mesa:armhf (9.0.0-2.1) ...
Removing libgl1-mesa-glx:armhf (13.0.6-1+rpi2) ...
Removing libglapi-mesa:armhf (13.0.6-1+rpi2) ...
Removing libglib2.0-dev (2.50.3-2) ...
Removing libglib2.0-bin (2.50.3-2) ...
Removing libllvm3.9:armhf (1:3.9.1-9+rpi1) ...
Removing unixodbc-dev (2.3.4-1) ...
Removing libodbc1:armhf (2.3.4-1) ...
Removing libpcre3-dev:armhf (2:8.39-3) ...
Removing libpcre32-3:armhf (2:8.39-3) ...
Removing libpcrecpp0v5:armhf (2:8.39-3) ...
Removing libslang2-dev:armhf (2.3.1-5) ...
Removing libpng-dev:armhf (1.6.28-1) ...
Removing libpng-tools (1.6.28-1) ...
Removing libx11-xcb-dev:armhf (2:1.6.4-3) ...
Removing libxcb-present-dev:armhf (1.12-1) ...
Removing libxcb-xfixes0-dev:armhf (1.12-1) ...
Removing libpulse-mainloop-glib0:armhf (10.0-1+deb9u1) ...
Removing libsasl2-dev (2.1.27~101-g0780600+dfsg-3) ...
Removing libsensors4:armhf (1:3.4.0-4) ...
Removing libtxc-dxtn-s2tc:armhf (1.0+git20151227-2) ...
Removing libxxf86vm-dev:armhf (1:1.1.4-1) ...
Removing libxdamage-dev:armhf (1:1.1.4-2+b1) ...
Removing libxfixes-dev:armhf (1:5.0.3-1) ...
Removing libx11-doc (2:1.6.4-3) ...
Removing libxcb-dri2-0-dev:armhf (1.12-1) ...
Removing libxcb-dri2-0:armhf (1.12-1) ...
Removing libxcb-dri3-dev:armhf (1.12-1) ...
Removing libxcb-dri3-0:armhf (1.12-1) ...
Removing libxcb-glx0-dev:armhf (1.12-1) ...
Removing libxcb-glx0:armhf (1.12-1) ...
Removing libxcb-present0:armhf (1.12-1) ...
Removing libxcb-randr0-dev:armhf (1.12-1) ...
Removing libxcb-randr0:armhf (1.12-1) ...
Removing libxcb-render0-dev:armhf (1.12-1) ...
Removing libxcb-render0:armhf (1.12-1) ...
Removing libxcb-shape0-dev:armhf (1.12-1) ...
Removing libxcb-shape0:armhf (1.12-1) ...
Removing libxcb-sync-dev:armhf (1.12-1) ...
Removing libxcb-sync1:armhf (1.12-1) ...
Removing libxcb-xfixes0:armhf (1.12-1) ...
Removing libxdamage1:armhf (1:1.1.4-2+b1) ...
Removing libxext-dev:armhf (2:1.3.3-1) ...
Removing libxfixes3:armhf (1:5.0.3-1) ...
Removing libxshmfence-dev:armhf (1.2-1) ...
Removing libxshmfence1:armhf (1.2-1) ...
Removing libxxf86vm1:armhf (1:1.1.4-1) ...
Removing x11proto-damage-dev (1:1.2.1-2) ...
Removing x11proto-fixes-dev (1:5.0-2) ...
Removing x11proto-xext-dev (7.3.0-1) ...
Removing x11proto-dri2-dev (2.8-2) ...
Removing x11proto-gl-dev (1.4.17-1) ...
Removing x11proto-xf86vidmode-dev (2.3.1-2) ...
Removing libpulse0:armhf (10.0-1+deb9u1) ...
Removing libasyncns0:armhf (0.8-6) ...
Removing libsndfile1:armhf (1.0.27-3) ...
Removing libflac8:armhf (1.3.2-1) ...
Removing libsm6:armhf (2:1.2.2-1+b1) ...
Removing libice6:armhf (2:1.0.9-2) ...
Removing libvorbisenc2:armhf (1.3.5-4+deb9u2) ...
Removing libvorbis0a:armhf (1.3.5-4+deb9u2) ...
Removing libogg0:armhf (1.3.2-1) ...
Removing libx11-dev:armhf (2:1.6.4-3) ...
Removing libx11-xcb1:armhf (2:1.6.4-3) ...
Removing libxtst6:armhf (2:1.2.3-1) ...
Removing libxi6:armhf (2:1.7.9-1) ...
Removing x11-common (1:7.7+19) ...
Removing x11proto-input-dev (2.3.2-1) ...
Removing x11proto-kb-dev (1.0.7-1) ...
Removing xtrans-dev (1.3.5-1) ...
Removing libxcb1-dev:armhf (1.12-1) ...
Removing libpthread-stubs0-dev:armhf (0.3-4) ...
Removing libxau-dev:armhf (1:1.0.8-1) ...
Removing libxdmcp-dev:armhf (1:1.1.2-3) ...
Removing x11proto-core-dev (7.0.31-1) ...
Removing xorg-sgml-doctools (1:1.11-1) ...
Removing odbcinst (2.3.4-1) ...
Removing odbcinst1debian2:armhf (2.3.4-1) ...
Processing triggers for libglib2.0-0:armhf (2.50.3-2) ...
No schema files found: doing nothing.
Processing triggers for sgml-base (1.29) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for man-db (2.7.6.1-2) ...
pi@raspberrypi:/etc/apt/sources.list.d $

--------------------------------------------------------------------------------------------------------------------------

Do "sudo apt-get update" to check the outcome.

pi@raspberrypi:/ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Get:2 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Hit:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Ign:2 http://repo.mosquitto.org/debian stretch InRelease
Fetched 11.0 kB in 5s (1,992 B/s)
Reading package lists... Done
W: GPG error: http://repo.mosquitto.org/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 61611AE430993623 Mosquitto Apt Repository <repo@mosquitto.org>
W: The repository 'http://repo.mosquitto.org/debian stretch InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
pi@raspberrypi:/ $

With reference to the info. at https://mosquitto.org/blog/2018/01/mosquitto-debian-repo-key-updated/


The problem could be solved by the issuing the following commands.

sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key

pi@raspberrypi:/ $ sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
--2018-11-11 15:17:17--  http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3120 (3.0K) [application/octet-stream]
Saving to: ‘mosquitto-repo.gpg.key’

mosquitto-repo.gpg.key           100%[==========================================================>]   3.05K  --.-KB/s    in 0s

2018-11-11 15:17:18 (19.3 MB/s) - ‘mosquitto-repo.gpg.key’ saved [3120/3120]

pi@raspberrypi:/ $ sudo apt-key add mosquitto-repo.gpg.key
OK
pi@raspberrypi:/ $ sudo apt-get update
Get:1 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Hit:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Fetched 11.0 kB in 5s (2,011 B/s)
Reading package lists... Done
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/mosquitto-jessie.list:1 and /etc/apt/sources.list.d/mosquitto-stretch.list:1
pi@raspberrypi:/ $

The "xxx is configured multiple times" issue could be solved by commenting out "deb http://repo.mosquitto.org/debian stretch main" in /etc/apt/sources.list.d/mosquitto-jessie.list.

Use the comand below to open "/etc/apt/sources.list.d/mosquitto-jessie.list" for editing.

sudo nano /etc/apt/sources.list.d/mosquitto-jessie.list

pi@raspberrypi:/etc/apt/sources.list.d $ sudo nano /etc/apt/sources.list.d/mosquitto-jessie.list

Comment out "deb http://repo.mosquitto.org/debian stretch main" as shown below.


Do "sudo apt-get update" again to check the outcome.

pi@raspberrypi:/etc/apt/sources.list.d $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Reading package lists... Done
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: Failed to fetch https://repo.mosquitto.org/debian/dists/stretch/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.
pi@raspberrypi:/etc/apt/sources.list.d $

Install "package apt-transport-https".

pi@raspberrypi:/ $ sudo apt-get install  apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 165 kB of archives.
After this operation, 221 kB of additional disk space will be used.
Get:1 http://mirror.ossplanet.net/raspbian/raspbian stretch/main armhf apt-transport-https armhf 1.4.8 [165 kB]
Fetched 165 kB in 1s (111 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 44844 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.4.8_armhf.deb ...
Unpacking apt-transport-https (1.4.8) ...
Setting up apt-transport-https (1.4.8) ...
pi@raspberrypi:/ $

Do "sudo apt-get update" again to check the outcome.

pi@raspberrypi:/ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Hit:3 https://repo.mosquitto.org/debian stretch InRelease
Reading package lists... Done
pi@raspberrypi:/ $

Now, there is no more error or warning when running sudo apt-get update and  sudo apt-get upgrade.

pi@raspberrypi:/ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Hit:3 https://repo.mosquitto.org/debian stretch InRelease
Reading package lists... Done
pi@raspberrypi:/ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  curl libcurl3 libcurl3-gnutls libcurl4-openssl-dev python-rpi.gpio
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,092 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian stretch/main armhf python-rpi.gpio armhf 0.6.4~stretch-1 [23.4 kB]
Get:2 http://mirror.ossplanet.net/raspbian/raspbian stretch/main armhf libcurl4-openssl-dev armhf 7.52.1-5+deb9u8 [327 kB]
Get:3 http://mirror.ossplanet.net/raspbian/raspbian stretch/main armhf curl armhf 7.52.1-5+deb9u8 [220 kB]
Get:4 http://mirror.ossplanet.net/raspbian/raspbian stretch/main armhf libcurl3 armhf 7.52.1-5+deb9u8 [262 kB]
Get:5 http://mirror.ossplanet.net/raspbian/raspbian stretch/main armhf libcurl3-gnutls armhf 7.52.1-5+deb9u8 [259 kB]
Fetched 1,092 kB in 6s (159 kB/s)
(Reading database ... 44850 files and directories currently installed.)
Preparing to unpack .../libcurl4-openssl-dev_7.52.1-5+deb9u8_armhf.deb ...
Unpacking libcurl4-openssl-dev:armhf (7.52.1-5+deb9u8) over (7.52.1-5+deb9u7) ...
Preparing to unpack .../curl_7.52.1-5+deb9u8_armhf.deb ...
Unpacking curl (7.52.1-5+deb9u8) over (7.52.1-5+deb9u7) ...
Preparing to unpack .../libcurl3_7.52.1-5+deb9u8_armhf.deb ...
Unpacking libcurl3:armhf (7.52.1-5+deb9u8) over (7.52.1-5+deb9u7) ...
Preparing to unpack .../libcurl3-gnutls_7.52.1-5+deb9u8_armhf.deb ...
Unpacking libcurl3-gnutls:armhf (7.52.1-5+deb9u8) over (7.52.1-5+deb9u7) ...
Preparing to unpack .../python-rpi.gpio_0.6.4~stretch-1_armhf.deb ...
Unpacking python-rpi.gpio (0.6.4~stretch-1) over (0.6.3~stretch-1) ...
Setting up libcurl3:armhf (7.52.1-5+deb9u8) ...
Setting up libcurl3-gnutls:armhf (7.52.1-5+deb9u8) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libcurl4-openssl-dev:armhf (7.52.1-5+deb9u8) ...
Setting up python-rpi.gpio (0.6.4~stretch-1) ...
Setting up curl (7.52.1-5+deb9u8) ...
pi@raspberrypi:/ $

========================================================================

Testing Mosquitto Broker and Client on Raspbbery Pi

Follow the instruction at the link below to test the MQTT Broker and Client.
https://randomnerdtutorials.com/testing-mosquitto-broker-and-client-on-raspbbery-pi/

Below is the test result of my upgraded MQTT.


No comments:

Post a Comment