I received the following error whilst installing wpasupplicant

$ sudo apt-get install wpasupplicant
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
Suggested packages:
   pcscd wpagui
The following NEW packages will be installed:
   libpcsclite1 wpasupplicant
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/847 kB of archives.
After this operation, 2,173 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package libpcsclite1:armhf.
(Reading database ... 134758 files and directories currently installed.)
Preparing to unpack .../libpcsclite1_1.8.20-1_armhf.deb ...
Unpacking libpcsclite1:armhf (1.8.20-1) ...
Selecting previously unselected package wpasupplicant.
Preparing to unpack .../wpasupplicant_2%3a2.4-1+deb9u1_armhf.deb ...
Unpacking wpasupplicant (2:2.4-1+deb9u1) ...
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/wpasupplicant_2%3a2.4-1+deb9u1_armhf.deb (--unpack):
 cannot copy extracted data for './sbin/wpa_supplicant' to '/sbin/wpa_supplicant.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Before attempting the installation I first ran apt-get update / apt-get dist-upgrade / sudo rpi-update (followed by a reboot). These all finished without any problems.

Installing wpasupplicant manually via also did not work:

wget http://security.debian.org/debian-security/pool/updates/main/w/wpa/wpasupplicant_1.0-3+deb7u4_armhf.deb
sudo dpkg -i wpasupplicant_1.0-3+deb7u4_armhf.deb

Suggestions are welcome.

  • Why are you installing what is normally already installed? what Distro and version are you using. Commented Oct 26, 2017 at 16:53
  • I kept receiving errors when updating so I removed wpasupplicant entirely (purge). I am on the latest version of Raspbian Stretch.
    – Vincent
    Commented Oct 26, 2017 at 17:11

1 Answer 1


This worked for me:

sudo rm /var/cache/apt/archives/wpasupplicant_2%3a2.7+git20190128+0c1e29f-6+deb10u1_armhf.deb
apt-get upgrade -f

Credit to: https://askubuntu.com/questions/1011008/dpkg-error-cannot-copy-extracted-data-for-unexpected-end-of-file-or-stream

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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