apt-get geralmente falha, com pacotes de software e com atualização

1

Estou executando uma VM do servidor Ubuntu 14.04.4 usando a caixa virtual. Eu configurei a rede para estar na configuração "adaptador em ponte". Eu atribuí manualmente o IP do mesmo endereço da rede em que a máquina do Windows está ligada. Gateway é o roteador sem fio. Eu sou capaz de ping IPs públicos e URIs estão sendo traduzidos também.

Quando tento instalar um pacote de software como 'chrony', com sudo apt-get install chrony , recebo a seguinte saída imediatamente.

root@controller:~# apt-get install chrony
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package chrony

Quando tento atualizar o apt com sudo apt-get update , obtenho a saída,

    root@controller:~# apt-get update
Err http://extras.ubuntu.com trusty InRelease

Err http://extras.ubuntu.com trusty Release.gpg
  Unable to connect to extras.ubuntu.com:http:
Err http://archive.canonical.com trusty InRelease

Err http://archive.canonical.com trusty Release.gpg
  Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
Err http://in.archive.ubuntu.com trusty InRelease

Err http://in.archive.ubuntu.com trusty-updates InRelease

Err http://in.archive.ubuntu.com trusty-backports InRelease

Err http://in.archive.ubuntu.com trusty Release.gpg
  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]
Err http://in.archive.ubuntu.com trusty-updates Release.gpg
  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]
Err http://in.archive.ubuntu.com trusty-backports Release.gpg
  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]
Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
  Unable to connect to security.ubuntu.com:http: [IP: 91.189.91.23 80]
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to extras.ubuntu.com:http:

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Unable to connect to security.ubuntu.com:http: [IP: 91.189.91.23 80]

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

Meu /etc/network/interfaces é:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1

#2nd if
auto eth1
iface eth1 inet static
address 192.168.1.100
netmask 255.255.255.0
#gateway 192.168.0.1


dns-nameservers 8.8.8.8 4.2.2.2

meu arquivo /etc/apt/sources.list é semelhante a este

#deb cdrom:[Ubuntu-Server 14.04.4 LTS _Trusty Tahr_ - Release amd64 (20160217.1)]/ trusty main restricted

#deb cdrom:[Ubuntu-Server 14.04.4 LTS _Trusty Tahr_ - Release amd64 (20160217.1)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty universe
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

Eu tentei desativar o roteamento IPv6 para isso. Eu não enfrento tal problema com as tentativas anteriores, me sinto perplexo depois de três dias. Qualquer insight seria apreciado. Parece que eu perdi algo claramente óbvio, mas sendo indiferente a isso.

Muito obrigado.

    
por panickedprocrastinator 21.06.2016 / 20:37

2 respostas

0

Tente executar o ping ' google.com ' ... e se ele não conseguir fazer o ping, faça o seguinte:

Edite /etc/resolv.conf e adicione

AVISO: você pode usar qualquer editor de texto, por exemplo, ' vi /etc/resolv.conf '

nameserver 8.8.8.8
nameserver 8.8.4.4

No final de /etc/resolv.conf - ou no topo, se estiver em arquivo vazio.

Deve funcionar agora, por favor me diga o que aconteceu nos comentários:)

EDITAR: notei em / etc / network / interfaces - que você já tem o campo "dns-nameservers" iniciado nos Google Nameservers, mas tente fazer isso também no meu método:)

    
por protld 21.06.2016 / 20:46
0

EDITAR: Bem! essa solução vai 100% consertar (espero) ... Porque eu tentei usar a sua cópia ' sources.list ' e eu peguei o mesmo problema ... Depois disso eu tentei reverter o padrão 'sources.list' usando o método abaixo e 100% worke d (Testado!) :)

Bem, como suas configurações de rede estão bem e você é capaz de pingar tudo bem. Vamos restaurar o arquivo ' sources.list ' padrão da sua instalação do Ubuntu.

Então comece excluindo o corrompido ' sources.list ' e vamos substituí-lo nas próximas etapas:

sudo rm /etc/apt/sources.list

Agora abra ' software-properties-gtk ', que criará automaticamente um novo arquivo ' sources.list ' vazio

sudo software-properties-gtk

Em ' software-properties-gtk ', marque (check) ' Community-maintained free and open-source software (universe) '

Em seguida, defina ' Download from: ' como ' Server for USA ' ou qualquer servidor que esteja próximo da sua localização.

E, claro, clique no botão ' Revert '.

imagem

    
por protld 22.06.2016 / 15:14