apt-get update: 416 Requested Range Not Satisfiable
We were trying to run a puppet update on some machines last week and one of the first things it does is run 'apt-get update' which was working on all but one node for which it was returning the following exception:
Err http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ i386 Packages
416 Requested Range Not Satisfiable
Fetched 5,079B in 2s (2,296B/s)
W: Failed to fetch http://us-west-1.ec2.archive.ubuntu.com/ubuntu/dists/maverick-updates/main/binary-i386/Packages.gz
416 Requested Range Not Satisfiable
It turns out one way that exception can manifest is if you’ve got a partial copy of the index files from the repository and in this case the solution was as simple as deleting those and trying again:
sudo rm -rf /var/lib/apt/lists/partial/*
Running 'apt-get update' again after that worked perfectly and the world was a happy place again.
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.