web-dev-qa-db-ja.com

update-initramfs -u中に「バージョン 'KERNEL_VERSION'の構文が正しくない:バージョン番号が数字で始まらない」の原因

Sudo update-initramfs -uを実行すると、エラー出力が表示されます

dpkg: warning: version 'KERNEL_VERSION' has bad syntax: version number does not start with digit
update-initramfs: Generating /boot/initrd.img-KERNEL_VERSION
dpkg: warning: version 'KERNEL_VERSION' has bad syntax: version number does not start with digit
grep: /boot/config-KERNEL_VERSION: No such file or directory
WARNING: missing /lib/modules/KERNEL_VERSION
Device driver support needs thus be built-in linux image!
depmod: FATAL: KERNEL_VERSION: not absolute path.
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
depmod: ERROR: could not open directory /tmp/mkinitramfs_Qe3Tum/lib/modules/4.0.0-040000-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory

誤ってリテラルとして解釈される変数が疑われるので、実行しました

  • Sudo grep -r 'KERNEL_VERSION' /boot/およびSudo grep -r 'KERNEL_VERSION' /lib/結果なし
  • Sudo grep -r 'KERNEL_VERSION' /usr/が返す結果が多すぎて調査できません。

Linux 4.0.0でUbuntu 15.04 AMD64を使用しています。

Sudo update-initramfs -u -vは出力を生成します

dpkg: warning: version 'KERNEL_VERSION' has bad syntax: version number does not start with digit
Available versions:  KERNEL_VERSION 4.0.0-040000-generic 3.19.3-031903-generic 3.19.0-15-generic 3.19.0-14-generic 3.16.0-23-generic
Keeping /boot/initrd.img-KERNEL_VERSION.dpkg-bak
update-initramfs: Generating /boot/initrd.img-KERNEL_VERSION
dpkg: warning: version 'KERNEL_VERSION' has bad syntax: version number does not start with digit
grep: /boot/config-KERNEL_VERSION: No such file or directory
linux-2.6 misses gzip support, using gzip
WARNING: missing /lib/modules/KERNEL_VERSION
Device driver support needs thus be built-in linux image!
depmod: FATAL: KERNEL_VERSION: not absolute path.
Adding binary /usr/lib/initramfs-tools/bin/wait-for-root
Adding library /lib/x86_64-linux-gnu/libudev.so.1
Adding library /lib/x86_64-linux-gnu/libc.so.6
Adding library /lib/x86_64-linux-gnu/libpthread.so.0
Adding library /lib64/ld-linux-x86-64.so.2
Adding binary /sbin/modprobe
Adding binary /sbin/rmmod
Adding binary /sbin/blkid
Adding library /lib/x86_64-linux-gnu/libblkid.so.1
Adding library /lib/x86_64-linux-gnu/libuuid.so.1
Calling hook brltty
Adding binary /usr/share/brltty/initramfs/brltty.sh
Adding binary /sbin/brltty-setup
Calling hook btrfs
Adding binary /sbin/btrfs
Adding library /lib/x86_64-linux-gnu/libz.so.1
Adding library /lib/x86_64-linux-gnu/liblzo2.so.2
Adding binary /sbin/btrfs-zero-log
Adding binary /sbin/fsck.btrfs
Calling hook compcache
Calling hook cryptroot
Calling hook dmraid
Adding binary /sbin/dmraid
Adding library /lib/libdmraid.so.1.0.0.rc16
Adding library /lib/x86_64-linux-gnu/libdevmapper.so.1.02.1
Adding library /lib/x86_64-linux-gnu/libselinux.so.1
Adding library /lib/x86_64-linux-gnu/libpcre.so.3
Adding library /lib/x86_64-linux-gnu/libdl.so.2
Adding binary /sbin/dmraid-activate
Calling hook framebuffer
Calling hook Fuse
Adding binary /sbin/mount.Fuse
Calling hook klibc
Calling hook kmod
Adding binary /bin/kmod
Calling hook mountall
Calling hook thermal
Calling hook udev
Adding binary /lib/systemd/systemd-udevd
Adding library /lib/x86_64-linux-gnu/libkmod.so.2
Adding library /lib/x86_64-linux-gnu/libacl.so.1
Adding library /lib/x86_64-linux-gnu/libattr.so.1
Adding binary /bin/udevadm
Adding binary /lib/udev/ata_id
Adding binary /lib/udev/scsi_id
Calling hook zz-busybox
Adding binary /bin/busybox
Calling hook cryptpassdev
Calling hook cryptopensc
Calling hook cryptopenct
Calling hook cryptkeyctl
Calling hook cryptgnupg
Calling hook plymouth
Adding binary /sbin/plymouthd
Adding library /lib/x86_64-linux-gnu/libply.so.4
Adding library /lib/x86_64-linux-gnu/libply-splash-core.so.4
Adding library /lib/x86_64-linux-gnu/librt.so.1
Adding library /lib/x86_64-linux-gnu/libm.so.6
Adding binary /bin/plymouth
Adding binary /lib/x86_64-linux-gnu/plymouth/details.so
Adding binary /lib/x86_64-linux-gnu/plymouth/ubuntu-text.so
Adding binary /lib/x86_64-linux-gnu/plymouth/script.so
Adding library /lib/x86_64-linux-gnu/libply-splash-graphics.so.4
Adding library /lib/x86_64-linux-gnu/libpng12.so.0
Adding binary /lib/x86_64-linux-gnu/plymouth/label.so
Adding library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
Adding library /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
Adding library /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
Adding library /usr/lib/x86_64-linux-gnu/libcairo.so.2
Adding library /lib/x86_64-linux-gnu/libglib-2.0.so.0
Adding library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
Adding library /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
Adding library /usr/lib/x86_64-linux-gnu/libfreetype.so.6
Adding library /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
Adding library /usr/lib/x86_64-linux-gnu/libthai.so.0
Adding library /usr/lib/x86_64-linux-gnu/libffi.so.6
Adding library /usr/lib/x86_64-linux-gnu/libpixman-1.so.0
Adding library /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
Adding library /usr/lib/x86_64-linux-gnu/libxcb-render.so.0
Adding library /usr/lib/x86_64-linux-gnu/libxcb.so.1
Adding library /usr/lib/x86_64-linux-gnu/libXrender.so.1
Adding library /usr/lib/x86_64-linux-gnu/libX11.so.6
Adding library /usr/lib/x86_64-linux-gnu/libXext.so.6
Adding library /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
Adding library /lib/x86_64-linux-gnu/libexpat.so.1
Adding library /usr/lib/x86_64-linux-gnu/libdatrie.so.1
Adding library /usr/lib/x86_64-linux-gnu/libXau.so.6
Adding library /usr/lib/x86_64-linux-gnu/libXdmcp.so.6
Adding library /usr/lib/x86_64-linux-gnu/libgraphite2.so.3
Adding binary /lib/x86_64-linux-gnu/libnss_files-2.21.so
Adding binary /lib/x86_64-linux-gnu/libnss_files.so.2
Adding binary /lib/x86_64-linux-gnu/plymouth/renderers/frame-buffer.so
Adding binary /lib/x86_64-linux-gnu/plymouth/renderers/drm.so
Adding library /usr/lib/x86_64-linux-gnu/libdrm.so.2
Adding binary /lib/x86_64-linux-gnu/plymouth/renderers/vga16fb.so
Calling hook ntfs_3g
Adding binary /bin/ntfs-3g
Adding library /lib/x86_64-linux-gnu/libntfs-3g.so.853
Calling hook console_setup
Calling hook kbd
Adding binary /bin/setfont
Adding binary /bin/kbd_mode
Adding binary /bin/loadkeys
Calling hook busybox
Adding binary /usr/lib/initramfs-tools/bin/busybox
Calling hook zdev
Adding binary /lib/udev/vdev_id
Adding binary /lib/udev/zvol_id
Calling hook watershed
Adding binary /lib/udev/watershed
Calling hook mdadm
Adding binary /sbin/mdadm
Adding binary /sbin/mdmon
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
Calling hook lvm2
Adding binary /sbin/dmsetup
Adding binary /sbin/lvm
Adding library /lib/x86_64-linux-gnu/libdevmapper-event.so.1.02.1
Adding library /lib/x86_64-linux-gnu/libreadline.so.5
Adding library /lib/x86_64-linux-gnu/libtinfo.so.5
Calling hook kpartx
Adding binary /sbin/kpartx
Adding binary /lib/udev/dmsetup_env
Adding binary /lib/udev/kpartx_id
Calling hook fixrtc
Adding binary /sbin/dumpe2fs
Adding library /lib/x86_64-linux-gnu/libext2fs.so.2
Adding library /lib/x86_64-linux-gnu/libcom_err.so.2
Adding library /lib/x86_64-linux-gnu/libe2p.so.2
Calling hook dmsetup
Calling hook bcache
Adding binary /lib/udev/bcache-register
Adding binary /lib/udev/probe-bcache
Calling hook flashcache
Adding binary /sbin/flashcache_load
Adding binary /sbin/flashcache_create
Adding binary /sbin/flashcache_destroy
depmod: ERROR: could not open directory /tmp/mkinitramfs_H6lHuZ/lib/modules/4.0.0-040000-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Building cpio /boot/initrd.img-KERNEL_VERSION.new initramfs
3
Karl Richter

/ var/lib/initramfs-toolsに「KERNEL_VERSION」という名前のフォルダーがあります

ある時点で、あなたまたは何らかのスクリプトが誤って作成しました。

ぶらぶらするには、findを使用する必要があります。

for x in /usr /var /boot; do find $x -name '*KERNEL_VERSION'; done

私の疑いが正しければ、あなたはで問題を修正することができます

Sudo rm -Rf /var/lib/initramfs-tools/KERNEL_VERSION
1
nuclearmistake

plsは、フォルダー/ var/lib/initramfs-tools /で誤ったエントリーをチェックし、それらを削除します。 「a」という名前のファイルがありましたが、これも同じエラーメッセージが表示されていました。

root@proxy:~# LANG=C dpkg-reconfigure initramfs-tools
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.103ubuntu4.2) ...
dpkg: warning: version 'a' has bad syntax: version number does not start with digit
update-initramfs: Generating /boot/initrd.img-a
dpkg: warning: version 'a' has bad syntax: version number does not start with digit
grep: /boot/config-a: No such file or directory
WARNING: missing /lib/modules/a
Device driver support needs thus be built-in linux image!
depmod: FATAL: a: not absolute path.
depmod: ERROR: could not open directory /tmp/mkinitramfs_fuhjWs/lib/modules/3.13.0-54-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory

「/ usr/sbin/update-initramfs」の行に「set -x」を追加した後、このフォルダーが見つかりました。

0
Thomas C.