In some conditions like those :
- Slow internet connections
- Slow PPA or sources
- Wifi internet access or 3g internet access
apt-get may stuck during update, install, upgrade or dist-upgrade.... endlessly (up to you to force it to close)
When I say stuck : it downloads the files, start the download, slow down and wait at some point and simply stop to download but still waiting the end of the file.
From what I understand it seems to occurs when there is a lot of latency variations (so when a server is saturated or with a wifi/3g internet access)
This effect affects also with official repositories. so it's not a source.list thing.
How can we tell to apt-get :
- to stop waiting endlessly
- retry to download when there is a timeout or a packet loss during the download
I am looking for a solution that does not involve brute force methods such as Ctrl+C or kill. I am looking for something more compatible with scripts (so no "human" intervention when the apt-get line has been launched).