![在 21.04 中安装任何软件包时出错](https://linux22.com/image/1183466/%E5%9C%A8%2021.04%20%E4%B8%AD%E5%AE%89%E8%A3%85%E4%BB%BB%E4%BD%95%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%97%B6%E5%87%BA%E9%94%99.png)
使用时出现以下错误apt install
:
/usr/share/initramfs-tools/hooks/cryptroot: 18: .: cannot open /lib/cryptsetup/functions: No such file
E: /usr/share/initramfs-tools/hooks/cryptroot failed with return 2.
update-initramfs: failed for /boot/initrd.img-5.11.0-31-generic with 2.
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
根据@Karel 的建议:
安装时收到以下错误cryptsetup
update-initramfs: Generating /boot/initrd.img-5.11.0-31-generic
Error: /sbin/zdb is not executable.
Error: /sbin/zpool is not executable.
Error: /sbin/zfs is not executable.
Error: /sbin/mount.zfs is not executable.
Error: /lib/udev/vdev_id is not executable.
Error: /lib/udev/zvol_id is not executable.
E: /usr/share/initramfs-tools/hooks/zfs failed with return 2.
update-initramfs: failed for /boot/initrd.img-5.11.0-31-generic with 2.
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您收到以下错误消息:
无法打开 /lib/cryptsetup/functions:没有此文件
/lib/cryptsetup/functions
由 Ubuntu 20.04 及更高版本中的 cryptsetup 提供。
运行以列出名称中
dpkg -l *5.11.0-31*|grep ii
包含字符串的已安装软件包。5.11.0-31
5.11.0-31
使用上一步清除名称中包含字符串的软件包,但要小心,只清除内核和支持文件包名称。sudo dpkg -P package_name
linux-
运行
sudo update-grub
重建GRUB启动菜单。运行
sudo reboot
以重新启动。安装 cryptsetup。
sudo apt update sudo apt install cryptsetup