我的系统停止了升级过程。它只能启动到旧内核(Linux 5.19.0-40-generic)。我有 Ubuntu 23.04。当我尝试时,sudo apt-upgrade
我收到错误:
$ sudo apt upgrade
[sudo] password for pepp:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-6.2.0-20-generic (6.2.0-20.20) ...
Setting up linux-headers-6.2.0-20-generic (6.2.0-20.20) ...
/etc/kernel/header_postinst.d/dkms:
* dkms: running auto installation service for kernel 6.2.0-20-generic
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Building module:
Cleaning build area...
'make' KVER=6.2.0-20-generic src=/usr/src/rtl88x2bu-5.8.7.1................................................(bad exit status: 2)
ERROR (dkms apport): binary package for rtl88x2bu: 5.8.7.1 not found
Error! Bad return status for module build on kernel: 6.2.0-20-generic (x86_64)
Consult /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
...fail!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
dpkg: error processing package linux-headers-6.2.0-20-generic (--configure):
installed linux-headers-6.2.0-20-generic package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-headers-
generic:
linux-headers-generic depends on linux-headers-6.2.0-20-generic; however:
Package linux-headers-6.2.0-20-generic is not configured yet.
dpkg: error processing package linux-headers-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 6.2.0.20.20); however:
Package linux-headers-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for linux-image-6.2.0-20-generic (6.2.0-20.20
) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 6.2.0-20-generic
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Building module:
Cleaning build area...
'make' KVER=6.2.0-20-generic src=/usr/src/rtl88x2bu-5.8.7.1.............................................(bad exit status: 2)
ERROR (dkms apport): binary package for rtl88x2bu: 5.8.7.1 not found
Error! Bad return status for module build on kernel: 6.2.0-20-generic (x86_64)
Consult /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
...fail!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.2.0-20-generic (--configure):
installed linux-image-6.2.0-20-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-headers-6.2.0-20-generic
linux-headers-generic
linux-generic
linux-image-6.2.0-20-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
谢谢大家的帮助!我尝试了“sudo dkms remove -m rtl88x2bu -v 5.8.7.1 -k --all 和 sudo apt -f install”。不幸的是,它返回了错误:
pepp@pepp-E3216-MD61800:~$ sudo dkms remove -m rtl88x2bu -v 5.8.7.1 -k --all
[sudo] password for pepp: Module rtl88x2bu 5.8.7.1 is not installed for kernel --all (x86_64). Skipping... Module rtl88x2bu 5.8.7.1 is not built for kernel --all (x86_64). Skipping... pepp@pepp-E3216-MD61800:~$ sudo apt -f install Reading package lists... Done Building dependency tree... Done Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded. 4 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up linux-image-6.2.0-20-generic (6.2.0-20.20) ... Setting up linux-headers-6.2.0-20-generic (6.2.0-20.20) ... /etc/kernel/header_postinst.d/dkms: * dkms: running auto installation service for kernel 6.2.0-20-generic Sign command: /usr/bin/kmodsign Signing key: /var/lib/shim-signed/mok/MOK.priv Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Building module: Cleaning build area... 'make' KVER=6.2.0-20-generic src=/usr/src/rtl88x2bu-5.8.7.1...............................................(bad exit status: 2) ERROR (dkms apport): binary package for rtl88x2bu:
5.8.7.1 not found Error! Bad return status for module build on kernel: 6.2.0-20-generic (x86_64) Consult /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log for more information. Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. ...fail! run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11 dpkg: error processing package linux-headers-6.2.0-20-generic (--configure): installed linux-headers-6.2.0-20-generic package post-installation script subpr ocess returned error exit status 1 dpkg: dependency problems prevent configuration of linux-headers-generic: linux-headers-generic depends on linux-headers-6.2.0-20-generic; however: Package linux-headers-6.2.0-20-generic is not configured yet.
dpkg: error processing package linux-headers-generic (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-headers-generic (= 6.2.0.20.20); however: Package linux-headers-generic is not configured yet.
dpkg: error processing package linux-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup erro r from a previous failure.
No apport report written because the error message ind icates its a followup error from a previous failure.
Processing triggers for linu x-image-6.2.0-20-generic (6.2.0-20.20) ... /etc/kernel/postinst.d/dkms: * dkms: running auto installation service for kernel 6.2.0-20-generic Sign command: /usr/bin/kmodsign Signing key: /var/lib/shim-signed/mok/MOK.priv Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Building module: Cleaning build area... 'make' KVER=6.2.0-20-generic src=/usr/src/rtl88x2bu-5.8.7.1..................... .............................(bad exit status: 2) ERROR (dkms apport): binary package for rtl88x2bu: 5.8.7.1 not found Error! Bad return status for module build on kernel: 6.2.0-20-generic (x86_64) Consult /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log for more information. Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. ...fail! run-parts: /etc/kernel/postinst.d/dkms exited with return code 11 dpkg: error processing package linux-image-6.2.0-20-generic (--configure): installed linux-image-6.2.0-20-generic package post-installation script subproc ess returned error exit status 1 No apport report written because MaxReports is reached already
Errors were encoun tered while processing: linux-headers-6.2.0-20-generic linux-headers-generic linux-generic linux-image-6.2.0-20-generic E: Sub-process /usr/bin/dpkg returned an error code (1)
当我输入“dpkg - l | grep dkms”时,我得到:
$ dpkg - l | grep dkms
dpkg: error: need an action option
Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
我尝试过“$ dpkg -l | grep dkms:
dpkg: error: need an action option
Type dpkg --help for help about installing and deinstalling packages [*]; Use 'apt' or 'aptitude' for user-friendly package management; Type dpkg -Dhelp for a list of dpkg debug flag values; Type dpkg
--force-help for a list of forcing options; Type dpkg-deb --help for help about manipulating *.deb files;
Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
现在我尝试“dpkg -l | grep dkms”并收到:
> ii dkms 3.0.10-7
> all Dynamic Kernel Module System (DKMS)
再次出错 :-(
sudo apt upgrade
[sudo] pepp 的密码:正在读取软件包列表... 完成正在构建依赖关系树... 完成正在读取状态信息... 完成正在计算升级... 完成以下软件包已被保留:gnome-video-effects linux-generic linux-headers-generic linux-image-generic ubuntu-drivers-common 以下软件包将被升级:cups-browsed linux-libc-dev 已升级 2 个软件包,新安装 0 个软件包,要删除 0 个软件包,未升级 5 个软件包。4 个软件包未完全安装或删除。需要获取 125 kB/1.661 kB 的档案。此操作后,将使用 0 B 的额外磁盘空间。是否要继续?[Y/n] y 获取:1http://archive.ubuntu.com/ubuntulunar-updates/main amd64 cups-browsed amd64 2.0~rc1-0ubuntu1.1 [125 kB] 在 0 秒内获取 125 kB (264 kB/s)
dpkg:警告:软件包“linux-headers-5.15.0-46”的文件列表文件丢失;假设软件包当前没有安装文件 dpkg:警告:软件包“linux-headers-5.15.0-46-generic”的文件列表文件丢失;假设软件包当前没有安装文件(正在读取数据库......当前安装了 356329 个文件和目录。)准备解压....../cups-browsed_2.0~rc1-0ubuntu1.1_amd64.deb......正在将 cups-browsed(2.0~rc1-0ubuntu1.1)解压到(2.0~rc1-0ubuntu1)......准备解压....../linux-libc-dev_6.2.0-24.24_amd64.deb......正在将 linux-libc-dev:amd64(6.2.0-24.24)解压到(6.2.0-23.23)......设置 cups-browsed(2.0~rc1-0ubuntu1.1)......设置 linux-headers-6.2.0-23-generic(6.2.0-23.23)...... /etc/kernel/header_postinst.d/dkms:
- dkms:正在运行内核 6.2.0-23-generic 的自动安装服务 签名命令:/usr/bin/kmodsign 签名密钥:/var/lib/shim-signed/mok/MOK.priv 公共证书(MOK):/var/lib/shim-signed/mok/MOK.der
构建模块:清理构建区域...“make” KVER=6.2.0-23-generic src=/usr/src/rtl88x2bu-5.8.7.1...............................................(错误退出状态:2) 错误(dkms apport):未找到 rtl88x2bu 的二进制包:5.8.7.1 错误!内核上模块构建的错误返回状态:6.2.0-23-generic(x86_64) 有关更多信息,请参阅 /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log。 6.2.0-23-generic/x86_64 上的 dkms 自动安装因 rtl88x2bu(10) 而失败 错误!自动安装期间一个或多个模块安装失败。有关更多信息,请参阅先前的错误。...失败! run-parts:/etc/kernel/header_postinst.d/dkms 退出,返回代码为 11 dpkg:处理软件包 linux-headers-6.2.0-23-generic 时出错(--configure):已安装 linux-headers-6.2.0-23-generic 软件包,安装后脚本子进程返回错误退出状态 1 正在设置 linux-libc-dev:amd64(6.2.0-24.24)... dpkg:依赖性问题阻止配置 linux-headers-generic:linux-headers-generic 依赖于 linux-headers-6.2.0-23-generic;但是:软件包 linux-headers-6.2.0-23-generic 尚未配置。
dpkg: 错误处理软件包 linux-headers-generic (--configure):依赖性问题 - 未配置设置 linux-image-6.2.0-23-generic (6.2.0-23.23) ... 没有写入 apport 报告,因为错误消息表明它是上次失败的后续错误。dpkg:依赖性问题阻止 linux-generic 的配置:linux-generic 依赖于 linux-headers-generic (= 6.2.0.23.23);但是:软件包 linux-headers-generic 尚未配置。
dpkg: 错误处理软件包 linux-generic (--configure):依赖性问题 - 未配置 没有写入 apport 报告,因为错误消息表明它是先前故障的后续错误。 处理 man-db (2.11.2-1) 的触发器... 处理 linux-image-6.2.0-23-generic (6.2.0-23.23) 的触发器... /etc/kernel/postinst.d/dkms:
- dkms:正在运行内核 6.2.0-23-generic 的自动安装服务 签名命令:/usr/bin/kmodsign 签名密钥:/var/lib/shim-signed/mok/MOK.priv 公共证书(MOK):/var/lib/shim-signed/mok/MOK.der
构建模块:清理构建区域... 'make' KVER=6.2.0-23-generic src=/usr/src/rtl88x2bu-5.8.7.1..............................................(错误退出状态:2) 错误 (dkms apport):未找到 rtl88x2bu 的二进制包:5.8.7.1 错误!内核上模块构建的错误返回状态:6.2.0-23-generic (x86_64) 有关更多信息,请参阅 /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log。 6.2.0-23-generic/x86_64 上的 dkms 自动安装因 rtl88x2bu(10) 而失败 错误!自动安装期间一个或多个模块安装失败。有关更多信息,请参阅先前的错误。...失败! run-parts:/etc/kernel/postinst.d/dkms 退出,返回代码 11 dpkg:错误处理软件包 linux-image-6.2.0-23-generic (--configure):已安装 linux-image-6.2.0-23-generic 软件包安装后脚本子进程返回错误退出状态 1 由于已达到 MaxReports,因此未写入 apport 报告处理时遇到错误:linux-headers-6.2.0-23-generic linux-headers-generic linux-generic linux-image-6.2.0-23-generic E:子进程 /usr/bin/dpkg 返回错误代码 (1)
答案1
sudo dkms remove -m rtl88x2bu -v 5.8.7.1 -k --all
再次删除干扰模块。
mkdir -p $HOME/apt-download/partial/
然后我们下载包 dkms 以便您的系统上可以使用它。
sudo apt-get -d -o dir::cache::archives="$HOME/apt-download/" install --reinstall dkms
现在软件包 dkms 位于 $HOME/apt-download/ 中,因此出于安全原因,您可以使用 apt 或 dpkg 安装;因为我们必须先摆脱它。
sudo dpkg -P dkms
检查
df -h;df -i
如果有足够的空间和 inode 可用,特别是如果您有自己的启动文件系统。
sudo apt update && sudo apt -f install