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:~ $