cp: -r 未指定;安装新内核时省略目录 '/etc/udev/rules.d/70-persistent-net.rules'
cp: -r not specified; omitting directory '/etc/udev/rules.d/70-persistent-net.rules' while installing a new kernel
虽然 运行 常规 apt upgrade
,apt 向我显示有一个新内核,但安装失败并显示以下消息:
Setting up linux-image-4.19.0-18-amd64 (4.19.208-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-18-amd64
cp: -r not specified; omitting directory '/etc/udev/rules.d/70-persistent-net.rules'
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.19.0-18-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.19.0-18-amd64 (--configure):
installed linux-image-4.19.0-18-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-4.19.0-18-amd64; however:
Package linux-image-4.19.0-18-amd64 is not configured yet.
Errors were encountered while processing:
linux-image-4.19.0-18-amd64
linux-image-amd64
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
而且它不会生成新的 initrd
。 apt install -f
、dpkg-reconfigure linux-image-4.19.0-18-amd64
、dpkg-reconfigure initramfs-tool
的 None 有效。我也下载了那些 deb 文件,但也无济于事。我应该继续做什么?
错误消息提示错误位于/usr/share/initramfs-tools/hooks/udev
。
在脚本末尾,您可以找到类似
的内容
# now copy all custom udev rules which don't have an equivalent in /lib (e. g.
# 70-persistent-net.rules or similar); They might contain network names or
# other bits which are relevant for the initramfs.
for rules in /etc/udev/rules.d/*.rules; do
if [ -e "$rules" ] && [ ! -e "/lib/${rules#/etc/}" ]; then
cp -p "$rules" "$DESTDIR/lib/udev/rules.d/"
fi
done
向 cp
添加一个 -r
选项,例如 cp -rp "$rules" "$DESTDIR/lib/udev/rules.d/
,在 apt install -f
.
之后一切运行顺利
虽然 运行 常规 apt upgrade
,apt 向我显示有一个新内核,但安装失败并显示以下消息:
Setting up linux-image-4.19.0-18-amd64 (4.19.208-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-18-amd64
cp: -r not specified; omitting directory '/etc/udev/rules.d/70-persistent-net.rules'
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.19.0-18-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.19.0-18-amd64 (--configure):
installed linux-image-4.19.0-18-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-4.19.0-18-amd64; however:
Package linux-image-4.19.0-18-amd64 is not configured yet.
Errors were encountered while processing:
linux-image-4.19.0-18-amd64
linux-image-amd64
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
而且它不会生成新的 initrd
。 apt install -f
、dpkg-reconfigure linux-image-4.19.0-18-amd64
、dpkg-reconfigure initramfs-tool
的 None 有效。我也下载了那些 deb 文件,但也无济于事。我应该继续做什么?
错误消息提示错误位于/usr/share/initramfs-tools/hooks/udev
。
在脚本末尾,您可以找到类似
的内容# now copy all custom udev rules which don't have an equivalent in /lib (e. g.
# 70-persistent-net.rules or similar); They might contain network names or
# other bits which are relevant for the initramfs.
for rules in /etc/udev/rules.d/*.rules; do
if [ -e "$rules" ] && [ ! -e "/lib/${rules#/etc/}" ]; then
cp -p "$rules" "$DESTDIR/lib/udev/rules.d/"
fi
done
向 cp
添加一个 -r
选项,例如 cp -rp "$rules" "$DESTDIR/lib/udev/rules.d/
,在 apt install -f
.