Running "sudo apt-get update" returns connection errors
This was caused by Kaspersky Total Security version 2019. It is a known issue that this version blocks HTTP and HTTPS traffic from consoles. It will be solved in the 2020 version next year, so in the meantime I uninstalled the 2019 version and reinstalled the 2018 version.