Issue
I use Ubuntu 16.04 on several machines at work.
On each of them, certain Debian packages are not correctly downloaded (corrupted).
Example with apt-get:
$ sudo apt-get install traceroute
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-53 linux-headers-4.4.0-53-generic linux-image-4.4.0-53-generic
linux-image-extra-4.4.0-53-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
traceroute
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 45.5 kB of archives.
After this operation, 177 kB of additional disk space will be used.
Get:1 http://fr.archive.ubuntu.com/ubuntu xenial/universe amd64 traceroute amd64 1:2.0.21-1 [45.5 kB]
Err:1 http://fr.archive.ubuntu.com/ubuntu xenial/universe amd64 traceroute amd64 1:2.0.21-1
Hash Sum mismatch
Fetched 44.8 kB in 0s (477 kB/s)
E: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/pool/universe/t/traceroute/traceroute_2.0.21-1_amd64.deb Hash Sum mismatch
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Example of manual install:
$ curl http://fr.archive.ubuntu.com/ubuntu/pool/universe/t/traceroute/traceroute_2.0.21-1_amd64.deb -o traceroute_2.0.21-1_amd64.deb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
95 45488 95 43538 0 0 353k 0 --:--:-- --:--:-- --:--:-- 354k
curl: (18) transfer closed with 1950 bytes remaining to read
$ sudo dpkg -i traceroute_2.0.21-1_amd64.deb
(Reading database ... 248576 files and directories currently installed.)
Preparing to unpack traceroute_2.0.21-1_amd64.deb ...
Unpacking traceroute (1:2.0.21-1) ...
dpkg-deb (subprocess): cannot copy archive member from 'traceroute_2.0.21-1_amd64.deb' to decompressor pipe: unexpected end of file or stream
dpkg-deb (subprocess): decompressing archive member: lzma error: unexpected end of input
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive traceroute_2.0.21-1_amd64.deb (--install):
cannot copy extracted data for './usr/lib/libsupp.a' to '/usr/lib/libsupp.a.dpkg-new': unexpected end of file or stream
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
traceroute_2.0.21-1_amd64.deb
As you can see, the file is not correctly downloaded with curl: curl: (18) transfer closed with 1950 bytes remaining to read
. wget also does not solve the problem.
Note that through a 4G connection share, the command works perfectly well.
I tried on Ubuntu 16.04 or 16.10 through docker: same problem.
I changed the Ubuntu repository (main, uk, it, etc.): same problem.
I am not the enterprise sys admin so I cannot check what's going on in this (windows) enterprise network.
Something corrupts certain file types, here .deb
.
Which work-around could I test?
Solution
I finally found a work-around: using an https Ubuntu repository.
This page shows a list of Ubuntu repositories which are accessible through https.
I used https://mirror.vorboss.net/ubuntu-archive/ which worked perfectly well.
In conclusion, I think that my enterprise network is "protected" by a firewall which refuses to let me download certain (always the same, systematically) .deb files. This firewall could make a signature of the new downloaded file, detect it as a "menace" and refuse to send me its last part.
Answered By - jbaptperez Answer Checked By - David Goodson (WPSolving Volunteer)