Introduction
The following information concentrates on the latest long-term versions of Debian, Ubuntu and Mint, namely Debian 9 (Stretch), Ubuntu 18.04 (Bionic) and Mint 19.x (Tara, Tessa, Tina, ...), but should be applicable, with modifications, to any Debian-derived distro.
Note that the instructions don't cover the addition or deletion of repositories to/from your software sources. It is intended rather as a diagnostic tool when
apt update is generating errors that appear...