Apt-get update / dist-upgrade are slow, keep failing

I have a lot of issues recently when trying to update packages on my Spark system:

apt-get update often fails to get all metadata.

Additionally, when I am able to run apt-get dist-upgrade, it gets some packages quickly, but then it slows down to a crawl.

The apt-get update issue seems related to apt-get trying to use IPv6 addresses, even though I have IPv4 on the local network, and my Internet provider has assigned me a public IPv4 address. Sometimes the command resolves all endpoints to IPv4 addresses, but that’s rare.

The apt-get dist-upgrade slowdown seems unrelated. It might be a kind of throttling, but it’s so brutal that the command take a very long time, and eventually times out.

The end result is that updates are failing behind.

Depending on where exactly it’s failing, have you seen this Ask Ubuntu post?

A DoS attack would explain it.

I wish they would spell out what those “official channels” are, so I could stay in touch.

@florin.andrei try forcing IPv4 only with sudo apt -o Acquire::ForceIPv4=true update Sometimes IPv6 routes are slow or broken, or both!

If it improves your experience make the setting permanent in apt configuration file(s)

I tried that, but it was so broken, even IPv6 endpoints were failing.

Anyway, seems fine now. All endpoints are very fast, and I can get my updates again.

Thanks everyone!