4
respostas

Erro ao usar o sudo apt update

Quando tento utilizar o sudo apt update são retornado os seguintes erros: Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Ign:2 http://archive.canonical.com/ubuntu jammy InRelease Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Ign:2 http://archive.canonical.com/ubuntu jammy InRelease Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Ign:2 http://archive.canonical.com/ubuntu jammy InRelease Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://archive.canonical.com/ubuntu jammy InRelease Temporary failure resolving 'archive.canonical.com' Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease Temporary failure resolving 'archive.ubuntu.com' Err:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-security/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.canonical.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'archive.canonical.com' W: Some index files failed to download. They have been ignored, or old ones used instead. root@Henrique:~#

Já tentei alterar o source.list, porém, não funcionou. Estou usando o WSL

4 respostas

Os erros indicam que o sistema não conseguiu baixar os arquivos de atualização do repositório Ubuntu, porque não consegue resolver o endereço dos servidores. A mensagem "Temporary failure resolving" significa que o sistema não consegue encontrar o endereço IP correspondente ao nome do servidor.

A primeira coisa que você pode fazer é verificar a conexão de rede do seu sistema. Certifique-se de que você tem uma conexão estável e que o seu WSL pode acessar a internet. Tente pingar um servidor de rede para testar a sua conectividade.

Se a sua conexão de rede estiver funcionando corretamente, tente atualizar novamente os repositórios usando o comando abaixo:

sudo apt-get update

Se isso ainda não funcionar, tente mudar para outro espelho de repositório. Você pode editar o arquivo /etc/apt/sources.list e alterar as URLs do repositório para um espelho diferente. Por exemplo, altere a linha abaixo:

http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse

Para esta linha:

http://us.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse

Depois disso, execute novamente o comando "sudo apt-get update" para atualizar os repositórios.

Se não der certo, pergunta no site stack overflow que é melhor/mais acompanhado que esse fórum da alura

  • Olá Henrique, tudo certo? já tentou o comando: sudo apt update && sudo apt upgrade, ele pede seu passaword, e logo em seguida realiza o update, vou deixar dois links aqui da Microsoft learn que conseguiu solucionar meus problemas com o WSL!

Configurar um ambiente de desenvolvimento WSL: https://learn.microsoft.com/pt-br/windows/wsl/setup/environment

Solução de problemas do Subsistema Windows para Linux: https://learn.microsoft.com/pt-br/windows/wsl/troubleshooting

Tranquilo, Weber. Acredito que o erro esteja relacionado a conexão com a internet, sabe como se conectar a uma rede via linha de comando?

Todas as formar que vi para se conectar a internet precisam instalar algum pacote, como o iw ou o net-tools, porém, sem conexão com a internet, não consigo realizar o download.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software