Same issue, different Ubuntu version, different archive.

Release: 18.04
apt:
  Installed: 1.6.14

My error:
```
Unpacking libpython3.6-dev:amd64 (3.6.9-1~18.04ubuntu1.4) over 
(3.6.9-1~18.04ubuntu1.3) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed 
data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive 
/tmp/apt-dpkg-install-mL3NjE/000-libpython3.6-dev_3.6.9-1~18.04ubuntu1.4_amd64.deb
 (--unpack):
 cannot copy extracted data for 
'./usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m-pic.a' to 
'/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m-pic.a.dpkg-new': 
unexpected end of file or stream
```

I diagnosed the issue as best I could:
- apt caches files in /var/cache/apt/archives
- I found the file libpython3.6-dev_3.6.9-1~18.04ubuntu1.4_amd64.deb
- On deleting this file, running the command again worked.

Therefore the bug in my case was clearly:
- apt downloaded a corrupt file
- apt did not verify that the file's checksum was correct
- apt proceeded to cache the file despite the checksum being incorrect
- the cached file is now on my system and apt refuses to redownload it
- therefore it is impossible to get it to work without user intervention, in 
this case by manually deleting the cached file

Suggested fix:
- verify that file checksums are correct BEFORE inserting the file into the 
cache
- if that is for some reason impossible (for instance if apt does not checksum 
files - which seems completely ludicrous to me from a security standpoint but I 
insert it here just in case), at least verify that the archive can be opened, 
before inserting into the cache
- ideally, if a file found in the cache cannot be uncompressed, delete it from 
the cache and fetch it again.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1928488

Title:
  Receiving error for /var/cache/apt/archives/fonts-noto-cjk compressed
  data is corrupt

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1928488/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to