[Seek Help] 为什么每次命令行安装软件都出现dkms错误? Resolved
Tofloor
poster avatar
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-10-16 00:24
Author

不知道弄了什么,现在每次命令行安装软件都提示dkms failed

当我输入

sudo apt install xxx

然后就会出现如下错误:

image.png

完整输出如下:

正在读取状态信息... 完成             
下列软件包是自动安装的并且现在不需要了:
  dde-cooperation-daemon dde-cooperation-transfer dde-file-manager-server-plugins l*coregtk-4.0-18 libplacebo292
  libwebkit2gtk-4.0-37 libwpe-1.0-1 libwpebackend-fdo-1.0-1
使用'sudo apt autoremove'来卸载它(它们)。
下列【新】软件包将被安装:
  d-feet
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 61.4 kB 的归档。
解压缩后会消耗 476 kB 的额外空间。
获取:1 https://community-packages.deepin.com/beige beige/main amd64 d-feet all 0.3.16-3 [61.4 kB]
已下载 61.4 kB,耗时 1秒 (68.7 kB/s)
正在选中未选择的软件包 d-feet。
(正在读取数据库 ... 系统当前共安装有 459332 个文件和目录。)
准备解压 .../d-feet_0.3.16-3_all.deb  ...
正在解压 d-feet (0.3.16-3) ...
正在设置 d-feet (0.3.16-3) ...
正在设置 linux-image-6.6.52-amd64-desktop-hwe (23.01.00.38) ...
dkms: running auto installation service for kernel 6.6.52-amd64-desktop-hwe.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/asg_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/ashmem_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/binder_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
dkms autoinstall on 6.6.52-amd64-desktop-hwe/x86_64 succeeded for deepin-anything nvidia
dkms autoinstall on 6.6.52-amd64-desktop-hwe/x86_64 failed for asg_xdroid(8) ashmem_xdroid(8) binder_xdroid(8)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.6.52-amd64-desktop-hwe failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
update-initramfs: Generating /boot/initrd.img-6.6.52-amd64-desktop-hwe
setupcon is missing. Please install the 'console-setup' package.
live-boot: core filesystems devices utils udev blockdev dns.
fix systemd/logind config
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin/theme.txt
Found background image: /boot/grub/themes/deepin/background.jpg
Found linux image: /boot/vmlinuz-6.6.52-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.52-amd64-desktop-hwe
Found linux image: /boot/vmlinuz-6.6.47-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.47-amd64-desktop-hwe
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
dpkg: 处理软件包 linux-image-6.6.52-amd64-desktop-hwe (--configure)时出错:
 已安装 linux-image-6.6.52-amd64-desktop-hwe 软件包 post-installation 脚本 子进程返回错误状态 1
dpkg: 依赖关系问题使得 linux-image-deepin-hwe-amd64 的配置工作不能继续:
 linux-image-deepin-hwe-amd64 依赖于 linux-image-6.6.52-amd64-desktop-hwe;然而:
  软件包 linux-image-6.6.52-amd64-desktop-hwe 尚未配置。

dpkg: 处理软件包 linux-image-deepin-hwe-amd64 (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在处理用于 bamfdaemon (0.5.6+repack-1) 的触发器 ...
Rebuilding /usr/share/applications/bamf-2.index...
正在处理用于 desktop-file-utils (0.26-deepin) 的触发器 ...
正在处理用于 hicolor-icon-theme (0.17-2) 的触发器 ...
正在处理用于 libglib2.0-0:amd64 (2.80.1-1deepin1) 的触发器 ...
正在处理用于 man-db (2.12.0-1) 的触发器 ...
在处理时有错误发生:
 linux-image-6.6.52-amd64-desktop-hwe
 linux-image-deepin-hwe-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

但是软件居然还是安装成了,很莫名其妙。

该怎么解决这个问题?

Reply Favorite View the author
All Replies
Oli
deepin
2024-10-16 02:49
#1

沙发 还有你不懂得

Reply View the author
守望风雨
deepin
2024-10-16 04:21
#2

看不懂.让AI跟你聊聊.

这个问题主要是由于DKMS(Dynamic Kernel Module Support)在安装或更新内核模块时失败造成的。具体来说,有几个模块(asg_xdroid、ashmem_xdroid和binder_xdroid)无法正确安装。这可能是由于源代码缺失或不兼容造成的。以下是一些可能的解决方法:

  1. 清理DKMS状态:
    sudo dkms autoinstall
    sudo dkms status
    查看状态,如果有失败的模块,尝试删除它们:
    sudo dkms remove <模块名>/<版本号> --all
  2. 更新系统:
    sudo apt update
    sudo apt upgrade
  3. 重新配置有问题的包:
    sudo dpkg --configure -a
    sudo apt install -f
  4. 如果问题仍然存在,可以尝试卸载这些有问题的模块:
    sudo apt remove asg_xdroid ashmem_xdroid binder_xdroid
  5. 安装缺失的包:
    sudo apt install console-setup
  6. 如果以上方法都不奏效,可以尝试重新安装内核:
    sudo apt install --reinstall linux-image-6.6.52-amd64-desktop-hwe
  7. 清理不需要的包:
    sudo apt autoremove
    如果问题仍然存在,可能需要检查 /var/lib/dkms/ 目录下是否有这些模块的源代码,或者考虑是否需要这些特定的模块。如果不需要,可以考虑完全移除它们。

请注意,在执行这些操作时要小心,最好先备份重要数据。如果不确定,建议寻求专业技术支持或在Deepin社区论坛上寻求帮助。

Reply View the author
Tonny
deepin
2024-10-16 08:06
#3
It has been deleted!
xclimbing
deepin
2024-10-16 08:48
#4

Error! The directory /var/lib/dkms/asg_xdroid/2.0/source does not appear to have module source located within it.
Build halted.

Error! The directory /var/lib/dkms/ashmem_xdroid/2.0/source does not appear to have module source located within it.
Build halted.

Error! The directory /var/lib/dkms/binder_xdroid/2.0/source does not appear to have module source located within it.
Build halted.

我只能看出来是缺乏三个模块的源码。

尝试着安装一下对应的模块源码呢?

Reply View the author
fallingstar-ten
deepin
2024-10-16 08:50
#5

目测是xdroid的内核模块在新内核上编译失败了?

可以试试卸载xdroid,更新内核,然后重装xdroid。

ps 以前在manjaro上工作的时候,更新内核和英伟达驱动经常遇到这种事

Reply View the author
昨夜的星辰
deepin
2024-10-16 09:20
#6

apt search linux-headers-6.6.52

看一下内核头文件安装了没,如果没安装这些模块是很有可能失败的,没安装就把内核头文件装一下

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-10-16 11:17
#7
守望风雨

看不懂.让AI跟你聊聊.

这个问题主要是由于DKMS(Dynamic Kernel Module Support)在安装或更新内核模块时失败造成的。具体来说,有几个模块(asg_xdroid、ashmem_xdroid和binder_xdroid)无法正确安装。这可能是由于源代码缺失或不兼容造成的。以下是一些可能的解决方法:

  1. 清理DKMS状态:
    sudo dkms autoinstall
    sudo dkms status
    查看状态,如果有失败的模块,尝试删除它们:
    sudo dkms remove <模块名>/<版本号> --all
  2. 更新系统:
    sudo apt update
    sudo apt upgrade
  3. 重新配置有问题的包:
    sudo dpkg --configure -a
    sudo apt install -f
  4. 如果问题仍然存在,可以尝试卸载这些有问题的模块:
    sudo apt remove asg_xdroid ashmem_xdroid binder_xdroid
  5. 安装缺失的包:
    sudo apt install console-setup
  6. 如果以上方法都不奏效,可以尝试重新安装内核:
    sudo apt install --reinstall linux-image-6.6.52-amd64-desktop-hwe
  7. 清理不需要的包:
    sudo apt autoremove
    如果问题仍然存在,可能需要检查 /var/lib/dkms/ 目录下是否有这些模块的源代码,或者考虑是否需要这些特定的模块。如果不需要,可以考虑完全移除它们。

请注意,在执行这些操作时要小心,最好先备份重要数据。如果不确定,建议寻求专业技术支持或在Deepin社区论坛上寻求帮助。

也是报错:

sudo apt install console-setup
请输入密码:
验证成功
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成             
下列软件包是自动安装的并且现在不需要了:
  dde-cooperation-daemon dde-cooperation-transfer dde-file-manager-server-plugins l*coregtk-4.0-18 libplacebo292
  libwebkit2gtk-4.0-37 libwpe-1.0-1 libwpebackend-fdo-1.0-1
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  console-setup-linux
下列【新】软件包将被安装:
  console-setup console-setup-linux
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 6 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 1,984 kB 的归档。
解压缩后会消耗 2,684 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://community-packages.deepin.com/beige beige/main amd64 console-setup-linux all 1.223 [1,882 kB]
获取:2 https://community-packages.deepin.com/beige beige/main amd64 console-setup all 1.223 [102 kB]                                  
已下载 1,984 kB,耗时 10秒 (192 kB/s)                                                                                                 
正在预设定软件包 ...
正在选中未选择的软件包 console-setup-linux。
(正在读取数据库 ... 系统当前共安装有 459463 个文件和目录。)
准备解压 .../console-setup-linux_1.223_all.deb  ...
正在解压 console-setup-linux (1.223) ...
正在选中未选择的软件包 console-setup。
准备解压 .../console-setup_1.223_all.deb  ...
正在解压 console-setup (1.223) ...
正在设置 linux-image-6.6.52-amd64-desktop-hwe (23.01.00.38) ...
dkms: running auto installation service for kernel 6.6.52-amd64-desktop-hwe.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/asg_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/ashmem_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/binder_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
dkms autoinstall on 6.6.52-amd64-desktop-hwe/x86_64 succeeded for deepin-anything nvidia
dkms autoinstall on 6.6.52-amd64-desktop-hwe/x86_64 failed for asg_xdroid(8) ashmem_xdroid(8) binder_xdroid(8)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.6.52-amd64-desktop-hwe failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
update-initramfs: Generating /boot/initrd.img-6.6.52-amd64-desktop-hwe
live-boot: core filesystems devices utils udev blockdev dns.
fix systemd/logind config
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin/theme.txt
Found background image: /boot/grub/themes/deepin/background.jpg
Found linux image: /boot/vmlinuz-6.6.52-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.52-amd64-desktop-hwe
Found linux image: /boot/vmlinuz-6.6.47-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.47-amd64-desktop-hwe
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
dpkg: 处理软件包 linux-image-6.6.52-amd64-desktop-hwe (--configure)时出错:
 已安装 linux-image-6.6.52-amd64-desktop-hwe 软件包 post-installation 脚本 子进程返回错误状态 1
正在设置 console-setup-linux (1.223) ...
Created symlink /etc/systemd/system/sysinit.target.wants/keyboard-setup.service → /usr/lib/systemd/system/keyboard-setup.service.
Created symlink /etc/systemd/system/multi-user.target.wants/console-setup.service → /usr/lib/systemd/system/console-setup.service.
insserv: FATAL: service mountkernfs has to be enabled to use service keyboard-setup.sh
正在设置 console-setup (1.223) ...
dpkg: 依赖关系问题使得 linux-image-deepin-hwe-amd64 的配置工作不能继续:
 linux-image-deepin-hwe-amd64 依赖于 linux-image-6.6.52-amd64-desktop-hwe;然而:
  软件包 linux-image-6.6.52-amd64-desktop-hwe 尚未配置。

dpkg: 处理软件包 linux-image-deepin-hwe-amd64 (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在处理用于 man-db (2.12.0-1) 的触发器 ...
在处理时有错误发生:
 linux-image-6.6.52-amd64-desktop-hwe
 linux-image-deepin-hwe-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-10-16 11:22
#8
昨夜的星辰

apt search linux-headers-6.6.52

看一下内核头文件安装了没,如果没安装这些模块是很有可能失败的,没安装就把内核头文件装一下

装了,估计是安装麟卓的时候被破坏了?

linux-headers-6.6.52-amd64-desktop-hwe/未知,now 23.01.00.38 amd64 [已安装,自动]
Linux kernel headers for 6.6.52-amd64-desktop-hwe on amd64

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-10-16 11:27
#9
fallingstar-ten

目测是xdroid的内核模块在新内核上编译失败了?

可以试试卸载xdroid,更新内核,然后重装xdroid。

ps 以前在manjaro上工作的时候,更新内核和英伟达驱动经常遇到这种事

没法卸载 xdroid,卸载失败

Reply View the author
守望风雨
deepin
2024-10-16 12:31
#10
把一切操作变成GUI

也是报错:

sudo apt install console-setup
请输入密码:
验证成功
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成             
下列软件包是自动安装的并且现在不需要了:
  dde-cooperation-daemon dde-cooperation-transfer dde-file-manager-server-plugins l*coregtk-4.0-18 libplacebo292
  libwebkit2gtk-4.0-37 libwpe-1.0-1 libwpebackend-fdo-1.0-1
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  console-setup-linux
下列【新】软件包将被安装:
  console-setup console-setup-linux
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 6 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 1,984 kB 的归档。
解压缩后会消耗 2,684 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://community-packages.deepin.com/beige beige/main amd64 console-setup-linux all 1.223 [1,882 kB]
获取:2 https://community-packages.deepin.com/beige beige/main amd64 console-setup all 1.223 [102 kB]                                  
已下载 1,984 kB,耗时 10秒 (192 kB/s)                                                                                                 
正在预设定软件包 ...
正在选中未选择的软件包 console-setup-linux。
(正在读取数据库 ... 系统当前共安装有 459463 个文件和目录。)
准备解压 .../console-setup-linux_1.223_all.deb  ...
正在解压 console-setup-linux (1.223) ...
正在选中未选择的软件包 console-setup。
准备解压 .../console-setup_1.223_all.deb  ...
正在解压 console-setup (1.223) ...
正在设置 linux-image-6.6.52-amd64-desktop-hwe (23.01.00.38) ...
dkms: running auto installation service for kernel 6.6.52-amd64-desktop-hwe.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/asg_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/ashmem_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
Sign command: /lib/modules/6.6.52-amd64-desktop-hwe/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The directory /var/lib/dkms/binder_xdroid/2.0/source does not appear to have module source located within it.
Build halted.
dkms autoinstall on 6.6.52-amd64-desktop-hwe/x86_64 succeeded for deepin-anything nvidia
dkms autoinstall on 6.6.52-amd64-desktop-hwe/x86_64 failed for asg_xdroid(8) ashmem_xdroid(8) binder_xdroid(8)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.6.52-amd64-desktop-hwe failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
update-initramfs: Generating /boot/initrd.img-6.6.52-amd64-desktop-hwe
live-boot: core filesystems devices utils udev blockdev dns.
fix systemd/logind config
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin/theme.txt
Found background image: /boot/grub/themes/deepin/background.jpg
Found linux image: /boot/vmlinuz-6.6.52-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.52-amd64-desktop-hwe
Found linux image: /boot/vmlinuz-6.6.47-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.47-amd64-desktop-hwe
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
dpkg: 处理软件包 linux-image-6.6.52-amd64-desktop-hwe (--configure)时出错:
 已安装 linux-image-6.6.52-amd64-desktop-hwe 软件包 post-installation 脚本 子进程返回错误状态 1
正在设置 console-setup-linux (1.223) ...
Created symlink /etc/systemd/system/sysinit.target.wants/keyboard-setup.service → /usr/lib/systemd/system/keyboard-setup.service.
Created symlink /etc/systemd/system/multi-user.target.wants/console-setup.service → /usr/lib/systemd/system/console-setup.service.
insserv: FATAL: service mountkernfs has to be enabled to use service keyboard-setup.sh
正在设置 console-setup (1.223) ...
dpkg: 依赖关系问题使得 linux-image-deepin-hwe-amd64 的配置工作不能继续:
 linux-image-deepin-hwe-amd64 依赖于 linux-image-6.6.52-amd64-desktop-hwe;然而:
  软件包 linux-image-6.6.52-amd64-desktop-hwe 尚未配置。

dpkg: 处理软件包 linux-image-deepin-hwe-amd64 (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在处理用于 man-db (2.12.0-1) 的触发器 ...
在处理时有错误发生:
 linux-image-6.6.52-amd64-desktop-hwe
 linux-image-deepin-hwe-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

看起来问题仍然存在。让我们尝试逐步解决这个问题:

  1. 首先,让我们尝试修复损坏的包:
    sudo apt --fix-broken install
  2. 如果上面的命令不能解决问题,我们可以尝试强制重新配置所有包:
    sudo dpkg --configure -a
  3. 如果还是不行,我们可以尝试删除那些有问题的DKMS模块:
    sudo dkms remove asg_xdroid/2.0 --all
    sudo dkms remove ashmem_xdroid/2.0 --all
    sudo dkms remove binder_xdroid/2.0 --all
  4. 然后,让我们尝试重新安装内核:
    sudo apt install --reinstall linux-image-6.6.52-amd64-desktop-hwe
  5. 如果以上步骤都不能解决问题,我们可以尝试完全删除这个内核版本,然后重新安装:
    sudo apt remove linux-image-6.6.52-amd64-desktop-hwe
    sudo apt autoremove
    sudo apt install linux-image-6.6.52-amd64-desktop-hwe
  6. 如果问题仍然存在,可能需要检查 /var/lib/dkms/ 目录下是否有这些模块的源代码:
    ls -l /var/lib/dkms/
    如果这些目录是空的或不存在,可能需要重新安装这些模块的源代码。
  7. 最后,如果所有这些方法都失败了,可能需要考虑报告这个问题给Deepin的开发团队。这可能是一个系统级的问题,需要他们的介入来解决。

请注意,在执行这些命令时要小心,最好先备份重要数据。如果不确定,建议在Deepin社区论坛上寻求进一步的帮助。

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-10-17 00:45
#11

手动清理DKMS 模块就好了

sudo dkms remove -m asg_xdroid -v 2.0 --all
sudo dkms remove -m ashmem_xdroid -v 2.0 --all
sudo dkms remove -m binder_xdroid -v 2.0 --all
Reply View the author