Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7074

How to force retry when an apt install has failed ? APT::Acquire::Retries does not seem to work [closed]

$
0
0

I am working with a corporate repository mirroring canonical repository. I suspect that this corporate repository is not reliable, because I have sporadic failures such as:

Failed to fetch ...  502  Bad Gateway [IP: ...]Failed to fetch ...  404  Not Found [IP: ...]

It does not seem to depend on the package to be installed. Taking that into account, I tried to use APT::Acquire::Retries:

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

(and yes, I am building a docker image)

Here's how I am installing the packages:

...&& apt install --no-install-recommends -y \        curl \        apt-utils \        iputils-ping \        nano \        gridsite-clients\ ...

I have the feeling that the APT::Acquire::Retries is not taken into account (ie by using higher values such as 30 ...).

The base image used is an ubuntu:20.04, with a version of apt equal to apt 2.0.8 (amd64).

Any clues ?

[Edited]By activating the following tweaks on apt.conf, I managed to get rid of 502 errors:

RUN echo '\Acquire::Retries "100";\Acquire::https::Timeout "240";\Acquire::http::Timeout "240";\APT::Get::Assume-Yes "true";\APT::Install-Recommends "false";\APT::Install-Suggests "false";\Debug::Acquire::https "true";\'> /etc/apt/apt.conf.d/99custom

In which case (read http status cod errors) Acquire::Retries works ?


Viewing all articles
Browse latest Browse all 7074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>