Ubuntu – sudo apt-get update stuck at 0% [Working]

16.04aptupdates

Running sudo apt-get update always get's stuck on 0% [Working]
Here's an example log:

➜  ~ sudo apt-get update
Hit:1 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu xenial 
InRelease
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease                                                                                                                                
Hit:3 http://repo.entroware.com/ubuntu xenial InRelease                                                                                                                                          
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                          
Hit:5 http://archive.ubuntu.com/ubuntu xenial-proposed InRelease                                                                                
Hit:6 http://gb.archive.ubuntu.com/ubuntu xenial InRelease                                                                
Hit:7 http://ppa.launchpad.net/webupd8team/atom/ubuntu xenial 
InRelease                             
Hit:8 http://gb.archive.ubuntu.com/ubuntu xenial-updates InRelease                            
Hit:9 http://gb.archive.ubuntu.com/ubuntu xenial-backports InRelease    
Hit:10 http://dl.google.com/linux/chrome/deb stable Release
0% [Working]                                       

It tends to get stuck on the same step multiple times in a row, but tends to change which step that is.

I've tried forcing IPv4 as well as changing to the default mirror with no success. I also can't seem to find any logs for this as tailing the /var/log/apt/term.log doesn't give me anything.

One thing to note is that switching mirror also changed the step it got stuck at.

Best Answer

It ended up being a problem with one of the sources. Specifically removing this line from /etc/apt/sources.list fixed it: deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable.

After that I ran clean, autoclean and followed this guide which added the same source back in after which point it continued working.

Hopefully this will be useful if someone encounters the same problem.