Gangmax Blog

Apt-get Connection Failed

The following error happens when I run “apt-get dist-upgrade”:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
~ $ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
erlang-asn1 erlang-base erlang-crypto erlang-inets erlang-mnesia
erlang-public-key erlang-runtime-tools erlang-ssl erlang-syntax-tools
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.8 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-inets amd64 1:17.5.3 [773 kB]
Get:2 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-ssl amd64 1:17.5.3 [615 kB]
Get:3 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-public-key amd64 1:17.5.3 [541 kB]
Get:4 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-asn1 amd64 1:17.5.3 [785 kB]
Get:5 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-syntax-tools amd64 1:17.5.3 [323 kB]
Get:6 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-runtime-tools amd64 1:17.5.3 [193 kB]
Get:7 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-mnesia amd64 1:17.5.3 [688 kB]
Get:8 http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-crypto amd64 1:17.5.3 [133 kB]
Err http://binaries.erlang-solutions.com/debian/ trusty/contrib erlang-base amd64 1:17.5.3
Connection failed
Fetched 4,050 kB in 6min 36s (10.2 kB/s)
E: Failed to fetch http://binaries.erlang-solutions.com/debian/pool/erlang-base_17.5.3-1~ubuntu~trusty_amd64.deb Connection failed

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

But actually that file is just there.

I figure out the workaround: download the file manually and put it in the local apt-get cache directory. After that, running “apt-get” will not try downloading it any more, instead it gets the file from the cache directory. Then it should work. BTW the local apt-get cache directory is gotten from here.

1
2
3
wget http://binaries.erlang-solutions.com/debian/pool/erlang-base_17.5.3-1~ubuntu~trusty_amd64.deb
sudo cp erlang-base_17.5.3-1~ubuntu~trusty_amd64.deb /var/cache/apt/archives/
sudo apt-get dist-upgrade

By doing so the problem is solved. But the root cause is still unknown.

Comments