从 20.04.2 升级时出现错误 未满足依赖项

从 20.04.2 升级时出现错误 未满足依赖项

我正在尝试从 20.04.2 升级。我收到此错误:

user@user:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-image-generic : Depends: linux-modules-extra-5.4.0-81-generic but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

运行 apt --fix-broken install 时出现此错误:

(Reading database ... 322814 files and directories currently installed.)
Preparing to unpack .../linux-modules-extra-5.4.0-81-generic_5.4.0-81.91_amd64.d
eb ...
Unpacking linux-modules-extra-5.4.0-81-generic (5.4.0-81.91) ...
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 /var/cache/apt/archives/linux-modules-extra-5.4.0
-81-generic_5.4.0-81.91_amd64.deb (--unpack):
 cannot copy extracted data for './lib/modules/5.4.0-81-generic/kernel/net/bluet
ooth/bluetooth.ko' to '/lib/modules/5.4.0-81-generic/kernel/net/bluetooth/blueto
oth.ko.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
 /var/cache/apt/archives/linux-modules-extra-5.4.0-81-generic_5.4.0-81.91_amd64.
deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我正在尝试升级以解决此问题,因为在我升级之前没有人会建议:浏览器和其他窗口导致 Ubuntu 20.04.2 LTS 崩溃

答案1

问题是:

Preparing to unpack .../linux-modules-extra-5.4.0-81-generic_5.4.0-81.91_amd64.deb ...
Unpacking linux-modules-extra-5.4.0-81-generic (5.4.0-81.91) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt

其余一切都是由于您的损坏包裹造成的连锁反应。

修复过程分为两个步骤:

  1. 手动删除损坏的包。

    软件包存储在 /var/cache/apt/archives 中。

    您知道包名称。它就在您的输出中。

    例子:sudo rm /var/cache/apt/archives/linux-modules-extra-5.4.0-81-generic_5.4.0-81.91_amd64.deb

  2. 让 apt 重新下载包

    例子:sudo apt-get upgrade

相关内容