Por que o apt-get verifica aleatoriamente recursos inexistentes?

2

Eu tenho um script automatizado que, entre outras tarefas, atualiza as fontes com apt-get update e, em seguida, instala pacotes adicionais por meio de apt-get install .

Ocasionalmente (10 a 20% do tempo), apt-get update falha com os seguintes erros:

init[356]: W: Failed to fetch http://http.us.debian.org/debian/dists/jessie/main/source/Sources 404 Not Found
init[356]: E: Some index files failed to download. They have been ignored, or old ones used instead.

De fato, o navegador mostra que o arquivo referenciado não existe: o diretório correspondente contém apenas os seguintes arquivos:

  • Release
  • Sources.gz
  • Sources.xz

O stdout de tal apt-get update com falha é este:

Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://http.us.debian.org jessie InRelease
Get:2 http://security.debian.org jessie/updates/main Sources [160 kB]
Get:3 http://http.us.debian.org jessie-updates InRelease [142 kB]
Get:4 http://security.debian.org jessie/updates/main amd64 Packages [302 kB]
Get:5 http://security.debian.org jessie/updates/main Translation-en [161 kB]
Hit http://http.us.debian.org jessie Release.gpg
Get:6 http://http.us.debian.org jessie-updates/main Sources [15.5 kB]
Get:7 http://http.us.debian.org jessie-updates/main amd64 Packages/DiffIndex [5,440 B]
Get:8 http://http.us.debian.org jessie-updates/main Translation-en/DiffIndex [2,704 B]
Hit http://http.us.debian.org jessie Release
Get:9 http://http.us.debian.org jessie/main amd64 Packages [6,761 kB]
Get:10 http://http.us.debian.org jessie/main Translation-en [4,580 kB]
Err http://http.us.debian.org jessie/main Sources
  404  Not Found
Fetched 12.2 MB in 28s (433 kB/s)

As duas últimas solicitações HTTP sendo:

http://http.us.debian.org/debian/dists/jessie/main/i18n/Translation-en.bz2
http://http.us.debian.org/debian/dists/jessie/main/source/Sources

Por comparação, aqui está apt-get update executado manualmente da mesma máquina depois que o original falhou:

Ign http://http.us.debian.org jessie InRelease
Get:1 http://http.us.debian.org jessie-updates InRelease [142 kB]
Get:2 http://http.us.debian.org jessie Release.gpg [2,373 B]              
Hit http://security.debian.org jessie/updates InRelease
Hit http://security.debian.org jessie/updates/main Sources
Hit http://security.debian.org jessie/updates/main amd64 Packages
Get:3 http://http.us.debian.org jessie-updates/main amd64 Packages/DiffIndex [5,440 B]
Hit http://security.debian.org jessie/updates/main Translation-en
Get:4 http://http.us.debian.org jessie-updates/main Translation-en/DiffIndex [2,704 B]
Get:5 http://http.us.debian.org jessie Release [148 kB]
Get:6 http://http.us.debian.org jessie-updates/main Sources [15.5 kB]
Get:7 http://http.us.debian.org jessie/main Sources [7,057 kB]
Get:8 http://http.us.debian.org jessie/main amd64 Packages [6,761 kB]
Get:9 http://http.us.debian.org jessie/main Translation-en [4,580 kB]
Fetched 18.7 MB in 12s (1,557 kB/s)                                            
Reading package lists... Done

e os três URIs correspondentes ao Get:7 to Get:9 :

http://http.us.debian.org/debian/dists/jessie/main/source/Sources.xz
http://http.us.debian.org/debian/dists/jessie/main/binary-amd64/Packages.xz
http://http.us.debian.org/debian/dists/jessie/main/i18n/Translation-en.bz2

Por que apt-get update ocasionalmente descobre que deve baixar Sources.xz , enquanto outras vezes tentando obter a Sources ausente?

    
por Arseni Mourzenko 30.08.2016 / 17:38

1 resposta

0

Faça o download de arquivos de lista compactados xz (ou gz) de qualquer lugar

echo 'Acquire::CompressionTypes::Order:: { "xz"; "gz"; };' > /etc/apt/apt.conf.d/47compress
    
por 30.08.2016 / 18:33

Tags