Como você resolve o erro de atualização do apt-get “Could not resolve”?

2

Acabei de adquirir espaço no servidor com um provedor de VPS. A primeira coisa que eu queria fazer é instalar a versão mais recente do Nginx. Eu segui as instruções oficiais do Nginx conforme descrito aqui . Tudo correu bem até que eu corri sudo apt-get update . Por alguma razão, parece que todos os repositórios em /etc/apt/sources.list atualizam corretamente, exceto aqueles para o Nginx que eu adicionei manualmente.

Eu tenho um servidor de teste na minha LAN que eu configurei exatamente da mesma forma que o servidor virtual virtual, então eu sei que a configuração funciona.

Sou relativamente novo em tudo isso, não tenho ideia do que pode estar causando isso, e não consegui encontrar ninguém on-line que tivesse o mesmo problema, mas tentei essas etapas de diagnóstico pelo que consegui encontrar:

Removeu todos os servidores de nomes em /etc/resolv.conf e adicionou apenas 8.8.8.8 do Google - não resolveu o problema e todos os repositórios tiveram erros quando executei sudo apt-get update

Sempre que tento ping , a saída é sempre connect: Network is unreachable

mas se eu executar host www.google.com , por exemplo, recebo esta saída:

www.google.com has address 74.125.28.147
www.google.com has address 74.125.28.99
www.google.com has address 74.125.28.103
www.google.com has address 74.125.28.104
www.google.com has address 74.125.28.105
www.google.com has address 74.125.28.106
www.google.com has IPv6 address 2607:f8b0:400e:c04::93

Esta é a saída de sudo apt-get update

Err http://nginx.org trusty InRelease

Err http://nginx.org trusty Release.gpg                                 
  Could not resolve 'nginx.org'
Ign http://mirrors.gandi.net trusty InRelease                                  
Hit http://mirrors.gandi.net trusty Release.gpg                                
Hit http://mirrors.gandi.net trusty Release                                    
Ign http://us.archive.ubuntu.com trusty InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Hit http://mirrors.gandi.net trusty/main amd64 Packages              
Ign http://us.archive.ubuntu.com trusty-updates InRelease                      
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]  
Ign http://us.archive.ubuntu.com trusty-backports InRelease           
Get:2 http://security.ubuntu.com trusty-security Release [63.5 kB]    
Hit http://us.archive.ubuntu.com trusty Release.gpg                            
Ign http://mirrors.gandi.net trusty/main Translation-en                        
Get:3 http://us.archive.ubuntu.com trusty-updates Release.gpg [933 B]          
Hit http://us.archive.ubuntu.com trusty-backports Release.gpg
Hit http://us.archive.ubuntu.com trusty Release          
Get:4 http://security.ubuntu.com trusty-security/main Sources [80.6 kB]
Get:5 http://us.archive.ubuntu.com trusty-updates Release [63.5 kB]
Hit http://us.archive.ubuntu.com trusty-backports Release             
Get:6 http://security.ubuntu.com trusty-security/restricted Sources [2061 B]
Hit http://us.archive.ubuntu.com trusty/main Sources
Get:7 http://security.ubuntu.com trusty-security/universe Sources [24.9 kB]
Hit http://us.archive.ubuntu.com trusty/restricted Sources                     
Get:8 http://security.ubuntu.com trusty-security/multiverse Sources [2335 B]
Hit http://us.archive.ubuntu.com trusty/universe Sources
Get:9 http://security.ubuntu.com trusty-security/main amd64 Packages [268 kB]
Hit http://us.archive.ubuntu.com trusty/multiverse Sources                 
Hit http://us.archive.ubuntu.com trusty/main amd64 Packages                
Hit http://us.archive.ubuntu.com trusty/restricted amd64 Packages          
Hit http://us.archive.ubuntu.com trusty/universe amd64 Packages            
Hit http://us.archive.ubuntu.com trusty/multiverse amd64 Packages           
Hit http://us.archive.ubuntu.com trusty/main Translation-en                 
Get:10 http://security.ubuntu.com trusty-security/restricted amd64 Packages [8875 B]
Hit http://us.archive.ubuntu.com trusty/multiverse Translation-en              
Get:11 http://security.ubuntu.com trusty-security/universe amd64 Packages [103 kB]
Hit http://us.archive.ubuntu.com trusty/restricted Translation-en             
Get:12 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [3680 B]
Hit http://us.archive.ubuntu.com trusty/universe Translation-en                
Hit http://security.ubuntu.com trusty-security/main Translation-en 
Get:13 http://us.archive.ubuntu.com trusty-updates/main Sources [202 kB]
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en     
Hit http://security.ubuntu.com trusty-security/restricted Translation-en       
Hit http://security.ubuntu.com trusty-security/universe Translation-en         
Get:14 http://us.archive.ubuntu.com trusty-updates/restricted Sources [2564 B]
Get:15 http://us.archive.ubuntu.com trusty-updates/universe Sources [117 kB]
Get:16 http://us.archive.ubuntu.com trusty-updates/multiverse Sources [5161 B]
Get:17 http://us.archive.ubuntu.com trusty-updates/main amd64 Packages [516 kB]
Get:18 http://us.archive.ubuntu.com trusty-updates/restricted amd64 Packages [9238 B]
Get:19 http://us.archive.ubuntu.com trusty-updates/universe amd64 Packages [279 kB]
Get:20 http://us.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [12.0 kB]
Hit http://us.archive.ubuntu.com trusty-updates/main Translation-en            
Hit http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en      
Hit http://us.archive.ubuntu.com trusty-updates/restricted Translation-en      
Hit http://us.archive.ubuntu.com trusty-updates/universe Translation-en        
Hit http://us.archive.ubuntu.com trusty-backports/main Sources                 
Hit http://us.archive.ubuntu.com trusty-backports/restricted Sources           
Hit http://us.archive.ubuntu.com trusty-backports/universe Sources             
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Sources           
Hit http://us.archive.ubuntu.com trusty-backports/main amd64 Packages          
Hit http://us.archive.ubuntu.com trusty-backports/restricted amd64 Packages    
Hit http://us.archive.ubuntu.com trusty-backports/universe amd64 Packages      
Hit http://us.archive.ubuntu.com trusty-backports/multiverse amd64 Packages    
Hit http://us.archive.ubuntu.com trusty-backports/main Translation-en          
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en    
Hit http://us.archive.ubuntu.com trusty-backports/restricted Translation-en    
Hit http://us.archive.ubuntu.com trusty-backports/universe Translation-en      
Fetched 1766 kB in 9s (189 kB/s)                                               
Reading package lists... Done
W: Failed to fetch http://nginx.org/packages/ubuntu/dists/trusty/InRelease  

W: Failed to fetch http://nginx.org/packages/ubuntu/dists/trusty/Release.gpg  Could not resolve 'nginx.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.

estas são as linhas que adicionei ao final de /etc/apt/sources.list para o Nginx:

deb http://nginx.org/packages/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/ubuntu/ trusty nginx
    
por JacksonHunt 16.05.2015 / 17:34

1 resposta

1

O problema era que o servidor virtual privado tinha apenas uma interface IPv6 e a localização do pacote Nginx oficial não suportava o IPv6 a partir de quando esta pergunta foi feita.

A empresa de hospedagem que eu uso oferece interfaces IPv6 gratuitamente, e cobra extra se você quiser uma interface IPv4 (já que os endereços IPv4 estão atingindo a indisponibilidade, é sua tentativa de conservá-los).

A solução foi simplesmente pagar pela interface IPv4. A atualização funciona de forma impecável após a implementação de uma interface IPv4.

    
por JacksonHunt 20.07.2015 / 14:55