cp: cannot stat `/lib/libnss_*': No such file or directory

Another Quick note as I keep running into this and every time go hunting for what I did to fix it last time.

When doing update/upgrades I run into the error cp: cannot stat `/lib/libnss_*': No such file or directory when it's running update-initramfs

This seems to be because of the dropbear hooks, that I use to decrypt a filesystem remotely.

https://bugs.launchpad.net/ubuntu/+source/dropbear/+bug/834174

Has all the info, but the basic steps for me are:-
nano -w /usr/share/initramfs-tools/hooks/dropbear
search for the line
cp /lib/libnss_* "${DESTDIR}/lib/"
Add x86_64-linux-gnu into the path making the line
cp /lib/x86_64-linux-gnu/libnss_* "${DESTDIR}/lib/"

UPDATE: This is valid for a 64bit system. For a 32bit system the path is more likely to be /lib/i386-linux-gnu/
This would make the line
cp /lib/i386-linux-gnu/libnss_* "${DESTDIR}/lib/"
Then run
update-initramfs -u
and no error.

Labels: ,