1

I live in the boondocks, where internet connection can be...well...let's just say "not so good." While trying to keep my system (Buster) up to date, using 'apt update,' the reported download rates regularly vary between tens of kB/s to hundreds of B/s, to dead stop. Not surprisingly, apt eventually gives up and terminates with "...some index files failed to download." Also, usually, with "Undetermined Error" or "Connection timed out" followed by an IP address.

Is there a way to get apt to try again, without re-issuing the command in the terminal?

2
  • Post ACTUAL error messages! A local mirror may help (depending on actual problem) see raspberrypi.stackexchange.com/a/105824/8697
    – Milliways
    Commented May 14, 2022 at 8:25
  • I second that a local mirror would help, especially if you have more than one device with the same OS that needs to be kept up to date!!
    – user10489
    Commented May 15, 2022 at 12:05

2 Answers 2

0

This question looks like it's a better fit for Superuser, but you should be able to do

until command
do
sleep 1
done

which will repeat command until it succeeds.

0

Create a new file ex. /etc/apt/apt.conf.d/99timeouts

Add the rows:

Acquire::http::timeout "240";
Acquire::https::timeout "240";

where "240" is a timeout in seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.