Running "sudo apt-get update" returns connection errors

Solution 1:

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.

Solution 2:

Do you by chance have Comcast Xfinity? I started to receive the same error a couple of days ago and it appears that Xfinity is intercepting traffic and returning a comcast "rules of use" page. xfinity error EDIT It appears that their notification system does some shady injection. On a refresh I finally received an actionable notification letting me know I was over my monthly usage and once I acknowledged it, issues subsided.

$ sudo apt update
Hit:1 http://repo.steampowered.com/steam precise InRelease
Hit:2 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:6 http://download.opensuse.org/repositories/home:/strycore/xUbuntu_18.04 ./ InRelease
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:8 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Hit:9 http://download.opensuse.org/repositories/home:/strycore/xUbuntu_18.04 ./ Release
Hit:10 http://ppa.launchpad.net/neovim-ppa/stable/ubuntu bionic InRelease
Fetched 163 kB in 1s (164 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.