18

Firefox fails to update due to corrupted download (deb)

Preparing to unpack .../firefox_32.0+build1-0ubuntu0.14.04.1_i386.deb ...
Unpacking firefox (32.0+build1-0ubuntu0.14.04.1) over (31.0+build1-0ubuntu0.14.04.1) ...
dpkg-deb (subprocess): decompressing archive member: lzma error:
 compressed data is corrupt
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive
 /var/cache/apt/archives/firefox_32.0+build1-0ubuntu0.14.04.1_i386.deb (--unpack):
 cannot copy extracted data for './usr/lib/firefox/libxul.so' to '/usr/lib/firefox/libxul.so.dpkg-new': 
 unexpected end of file or stream
Please restart all running instances of firefox, or you will experience problems.
0
31

Here's how I fixed it.

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

In case this does not work, try manually deleting the package located in /var/cache/apt/archives/path:

The example below is the deb file in question from the date this answer was written. Your file name will be different. It should be easy to find by checking the dpkg.log and/or utilizing bash auto-complete.

sudo rm /var/cache/apt/archives/firefox_32.0+build1-0ubuntu0.14.04.1_i386.deb
2
  • I have run into the same issue (lzma error: compressed data is corrupt) but with the wget command. Is there a fix for this?
    – AHL
    Aug 6 '20 at 8:58
  • @AHL Delete the damaged file from the location you downloaded to and try again? Better yet use the repositories and if the error repeats try a different mirror.
    – Elder Geek
    Aug 8 '20 at 13:28
7

apt clean fixed that problem for me on a Ubuntu 18.04.

1
  • 7
    You might go so far as to mention that this will completely nuke your /var/cache/apt/archives/ and recommend an update to repoopulate. It will work, but it's kind of like doing surgery with a hammer. Cheers!
    – Elder Geek
    Jan 23 '19 at 13:11
6

You need to remove the broken package in the archives directory then update and install firefox.

sudo apt-get autoremove
sudo apt-get update
sudo apt-get install firefox
0

I faced this issue because I abort the first download of the deb package and I restart it. The consequence was to have xxxx.deb and xxxx.deb.1 in my download folder. the .deb package was obvioulsly corrupted.

My solution was to remove the xxxx.deb package and rename the xxxx.deb.1 to xxxx.deb.

Another alternative should be to install directly the xxxx.deb.1 (I did not tried)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.