web-dev-qa-db-fra.com

Ce qui pourrait causer "la version 'KERNEL_VERSION' a une syntaxe incorrecte: le numéro de version ne commence pas par digit" pendant update-initramfs -u

Quand je lance Sudo update-initramfs -u j'obtiens la sortie d'erreur

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

Je soupçonne une variable qui est accidentellement interprétée comme littérale, alors j'ai couru

  • Sudo grep -r 'KERNEL_VERSION' /boot/ et Sudo grep -r 'KERNEL_VERSION' /lib/ sans résultat et
  • Sudo grep -r 'KERNEL_VERSION' /usr/ renvoie trop de résultats à étudier.

J'utilise Ubuntu 15.04 AMD64 avec Linux 4.0.0.

Sudo update-initramfs -u -v produit une sortie

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

Vous avez un dossier nommé 'KERNEL_VERSION' dans/var/lib/initramfs-tools

À un moment donné, vous ou un script l'avez créé par erreur.

pour fouiller, il faudrait utiliser find.

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

Si mes soupçons sont corrects, vous pouvez résoudre le problème avec

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

veuillez vérifier le répertoire/var/lib/initramfs-tools/pour les entrées incorrectes et les supprimer. J'avais là un fichier nommé "a" qui me donnait également les mêmes messages d'erreur que vous avez.

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

Après avoir ajouté "set -x" à la 2. ligne de "/ usr/sbin/update-initramfs", j'ai trouvé ce dossier.

0
Thomas C.