Score:0

Error while installing any packages in 21.04

cn flag
2.1

I am getting the following error while using 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)

As per suggestion by @Karel:

Received following errors while installing 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)
Score:0
sa flag

You got the following error message:

cannot open /lib/cryptsetup/functions: No such file

/lib/cryptsetup/functions is provided by cryptsetup in Ubuntu 20.04 and later.

  1. Run dpkg -l *5.11.0-31*|grep ii to list installed packages which contain the string 5.11.0-31 in their names.

  2. Purge the packages which contain the string 5.11.0-31 in their names from the previous step with sudo dpkg -P package_name but be careful to purge only the linux- kernel and support file package names.

  3. Run sudo update-grub to rebuild the GRUB boot menu.

  4. Run sudo reboot to reboot.

  5. Install cryptsetup.

    sudo apt update
    sudo apt install cryptsetup
    
2.1 avatar
cn flag
2.1
got some errors while installing `cryptsetup`. Kindly see the edited question for errors.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.