Home >System Tutorial >LINUX >How To Fix \
Troubleshooting "dpkg-deb: lzma error: compressed data is corrupt" in Debian 12
Encountering a "dpkg-deb: lzma error: compressed data is corrupt" message during a Debian 12 update signifies a corrupted package file. This guide provides a straightforward solution.
The Error
The error message typically resembles this:
<code>[...]Unpacking libreoffice-common (4:24.8.2-1~bpo12+1) over (4:24.2.6-2~bpo12+1) ...dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/libreoffice-common_4%3a24.8.2-1~bpo12+1_all.deb' (size=19330668) member 'data.tar': lzma error: compressed data is corruptdpkg-deb: error: <decompress> subprocess returned error exit status 2dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_4%3a24.8.2-1~bpo12+1_all.deb (--unpack): cannot copy extracted data for './usr/lib/libreoffice/share/template/common/presnt/Freshes.otp' to '/usr/lib/libreoffice/share/template/common/presnt/Freshes.otp.dpkg-new': unexpected end of file or stream[...]E: Sub-process /usr/bin/dpkg returned an error code (1)</decompress></code>
This indicates dpkg
, the package manager, has encountered a problem with a .deb
file (in this example, libreoffice-common
).
The Solution
Follow these steps to resolve the issue:
Clear the APT Cache: Remove corrupted packages from the APT cache using:
sudo apt clean
Update the Package List: Refresh the package list to ensure you have the latest information:
sudo apt update
Attempt an Upgrade: Try upgrading your packages. This will attempt to redownload any necessary files:
sudo apt upgrade
Fix Broken Packages (If Necessary): If step 3 fails, use this command to repair broken dependencies:
sudo apt --fix-broken install
Alternatively, the shorter version:
sudo apt install -f
This will attempt to reinstall the problematic package, resolving corruption or dependency issues.
Conclusion
By following these steps, you should successfully resolve the "dpkg-deb: lzma error: compressed data is corrupt" error in Debian 12. Remember to always back up important data before attempting significant system repairs. For other common Debian/Ubuntu issues, see the solutions listed below.
Additional Resources:
The above is the detailed content of How To Fix \. For more information, please follow other related articles on the PHP Chinese website!