How to fix apt "Cannot initiate the connection" on Ubuntu headless
Today, while updating my Ubuntu headless server, I got some errors from the mirror I was using: sudo apt-get update Err:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease Cannot initiate the connection to fi.archive.ubuntu.com:80 connect (101: Network is unreachable) ...and so on. Seems there is some problem with fi.archive.ubuntu.com, or maybe they stopped serving updates for my old LTS version of Ubuntu. This was solved with some editing of /etc/apt/sources.list sudo nano /etc/apt/sources.list I replaced http://fi.archive.ubuntu.com/ubuntu/ with mirror://mirrors.ubuntu.com/mirrors.txt. If you want to be sure, leave the old lines there commented with #, so you can go back if this doesn't help. So the lines would look like this now: deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted # deb http://fi.archive.ubuntu.com/ubuntu/ xenial main restricted deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted # deb ...