10

When using wget, -c is used to keep wget retrying to download, usually in the event of an internet interruption. What equivalent of -c can we use for apt-get to keep on retrying even in the case of unstable internet connection which keeps on getting disconnected?

Moyo Freeman
  • 315
  • 3
  • 12
  • 3
    Possible duplicate of [How to make a package manager wait if another instance of APT is running?](http://askubuntu.com/questions/132059/how-to-make-a-package-manager-wait-if-another-instance-of-apt-is-running) – Nisheet Jan 23 '17 at 10:59
  • 2
    For wget, `-c` is used to *resume* downloads from where they left off. If apt-get is interrupted for any reason, just try it again. For more specific issues, please provide details. Also, check the man pages for wget, apt-get, and apt for the switches available to each. – DK Bose Jan 23 '17 at 11:18
  • Related: https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure – Elder Geek Jan 26 '17 at 16:15
  • @DKBose Yeah except sometimes it doesn't keep everything it downloaded... I was 33% of the way once and when it restarted it went down to 27% – Michael Jun 12 '22 at 22:43

1 Answers1

22

From man apt.conf

Retries Number of retries to perform. If this is non-zero APT will retry failed files the given number of times.

echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries

Since apt 2.3.2, the default is 3.

gliptak
  • 604
  • 7
  • 13