Ubuntu – Vivid apt-get update huge Package files in /var/lib/apt/lists/partial

ls -Ssh /var/lib/apt/lists/partial | head

total 88G
46G security.ubuntu.com_ubuntu_dists_vivid-security_main_binary-amd64_Packages.bz2


I tried bunzipping and got trailing garbage:

bunzip2: us.archive.ubuntu.com_ubuntu_dists_vivid-updates_main_binary-i386_Packages.bz2: trailing garbage after EOF ignored


It looks like the decompressed file is only 88K:

 du -hs us.archive.ubuntu.com_ubuntu_dists_vivid-updates_main_binary-i386_Packages
88K


Doing a hex dump of the end of the file appears to reveal a directory listing being appended:

tail -c 200 security.ubuntu.com_ubuntu_dists_vivid-security_main_binary-amd64_Packages.bz2 | hexdump -C
00000000  30 38 64 66 37 20 20 20  20 20 20 20 20 20 20 20  |08df7           |
00000010  20 20 34 38 31 39 20 75  6e 69 76 65 72 73 65 2f  |  4819 universe/|
00000020  69 31 38 6e 2f 54 72 61  6e 73 6c 61 74 69 6f 6e  |i18n/Translation|
00000030  2d 65 6e 2e 62 7a 32 0a  20 31 30 66 64 62 31 61  |-en.bz2. 10fdb1a|
00000040  37 34 61 62 34 34 33 36  64 39 37 62 33 33 66 65  |74ab4436d97b33fe|
00000050  62 30 38 38 36 66 35 63  38 61 63 63 64 36 34 34  |b0886f5c8accd644|
00000060  33 62 36 34 36 37 61 30  64 63 39 61 63 39 64 31  |3b6467a0dc9ac9d1|
00000070  66 64 33 39 61 36 31 63  62 20 20 20 20 20 20 20  |fd39a61cb       |
00000080  20 20 20 20 20 20 31 35  38 31 20 75 6e 69 76 65  |      1581 unive|
00000090  72 73 65 2f 73 6f 75 72  63 65 2f 53 6f 75 72 63  |rse/source/Sourc|
000000a0  65 73 2e 62 7a 32 0a 20  61 64 66 35 31 32 30 66  |es.bz2. adf5120f|
000000b0  65 63 61 37 38 66 34 65  37 36 66 34 31 36 66 38  |eca78f4e76f416f8|
000000c0  31 30 32 31 36 62 33 30                           |10216b30|


Piping the tail though strings and greping for a file shows the same file listed over and over:

 tail -c 500K security.ubuntu.com_ubuntu_dists_vivid-security_main_binary-amd64_Packages.bz2 | strings  | grep -i multiverse/i18n/Translation-en.bz2


Has anyone run into this before?

Anyway: it's safe to delete everything from the directory /var/lib/apt/lists/partial/ (and also from /var/cache/apt/archives/partial/).
• Use wget or curl for checking what you get from the server when downloading without apt-get.