卸载linux-kernel-6.18.12出错

安装linux-kernel-6.18.25后,卸载linux-kernel-6.18.12,出现错误,卸载不了。用--fix-broken--fix-dpkg-status选项也不行。

$ sudo oma remove --fix-broken linux-kernel-6.18.12

1 package(s) will be REMOVED:

  Name                  |  Installed size  |  Detail  
------------------------+------------------+----------
  linux-kernel-6.18.12  |  -503.54 MiB     |          


Total download size: 0 B
Estimated change in storage usage: -503.54 MiB

(Reading database… 831827 files and directories currently installed.)
Removing linux-kernel-6.18.12 (6.18.12-2)…
Removing left-over directory for DKMS modules ...
rm: cannot remove '/usr/lib/modules//updates': No such file or directory
Removing left-over directory for DKMS modules ...
rm: cannot remove '/usr/lib/modules//updates': No such file or directory
dpkg: error processing package linux-kernel-6.18.12 (--remove):
 old linux-kernel-6.18.12 package postrm maintainer script subprocess failed with exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-kernel-6.18.12
Processing was halted because there were too many errors.
     INFO If you would like to undo these changes, please use the oma undo
          command.
    ERROR Unable to install Package(s).
          1: E: Sub-process /usr/bin/dpkg returned an error code (1)
   DUE TO This can be caused by problems with the quality of the software,
          corrupted system files or the system, or compatibility problems with
          the software.
     INFO Please share the above logs (screenshots) with AOSC OS maintainers so
          that we can investigate and make necessary improvements.
$ sudo oma remove --fix-dpkg-status linux-kernel-6.18.12

1 package(s) will be REMOVED:

  Name                  |  Installed size  |  Detail  
------------------------+------------------+----------
  linux-kernel-6.18.12  |  -503.54 MiB     |          


Total download size: 0 B
Estimated change in storage usage: -503.54 MiB

(Reading database… 831827 files and directories currently installed.)
Removing linux-kernel-6.18.12 (6.18.12-2)…
Removing left-over directory for DKMS modules ...
rm: cannot remove '/usr/lib/modules//updates': No such file or directory
Removing left-over directory for DKMS modules ...
rm: cannot remove '/usr/lib/modules//updates': No such file or directory
dpkg: error processing package linux-kernel-6.18.12 (--remove):
 old linux-kernel-6.18.12 package postrm maintainer script subprocess failed with exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-kernel-6.18.12
Processing was halted because there were too many errors.
     INFO If you would like to undo these changes, please use the oma undo
          command.
    ERROR Unable to install Package(s).
          1: E: Sub-process /usr/bin/dpkg returned an error code (1)
   DUE TO This can be caused by problems with the quality of the software,
          corrupted system files or the system, or compatibility problems with
          the software.
     INFO Please share the above logs (screenshots) with AOSC OS maintainers so
          that we can investigate and make necessary improvements.

现在使用sudo oma upgrade也会出错误,但sudo oma upgrade --no-fix-dpkg-status可以正常使用。

$ sudo oma upgrade
     INFO Refreshing local database ...
    ERROR oma is unable to repair linux-kernel-6.18.12: unable find checksum for
          this local or 3rd-party package.

请问如何解决?

請參考 https://mp.weixin.qq.com/s/9JmpTRX5PbVysCBuyE26ww

按照链接方法处理,已解决。谢谢。