报错信息
Failed to restart udev.service: Unit systemd-udevd.service is not loaded properly: Exec format error.
See system logs and ‘systemctl status udev.service’ for details.
invoke-rc.d: initscript udev, action “restart” failed.
● systemd-udevd.service - udev Kernel Device Manager
Loaded: error (Reason: Exec format error)
Active: active (running) since Fri 2024-05-24 10:25:21 CST; 33min ago
Docs: man:systemd-udevd.service(8)
man:udev(7)
Main PID: 421 (systemd-udevd)
Status: “Processing with 40 children at max”
Tasks: 1 (limit: 4915)
CGroup: /system.slice/systemd-udevd.service
└─421 /lib/systemd/systemd-udevd
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Got notification message from PID 421, but reception is disabled.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Got notification message from PID 421, but reception is disabled.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Got notification message from PID 421, but reception is disabled.
May 24 10:58:38 hikai-Default-string systemd[1]: /lib/systemd/system/systemd-udevd.service:27: Executable path is not absolute: udevadm control --reload --timeout 0
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.
May 24 10:58:38 hikai-Default-string systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.
解决方法
参考了这篇文章: Linux常见问题三则:systemd-udev-settle.service: Executable path is not absolute, ignoring: udevadm settle
先打开这个文件:
sudo vim /lib/systemd/system/systemd-udevd.service
输入“/”进行搜索,搜索内容为报错的关键信息:“/lib/systemed/systemd-udevd”
在这一行的下面,是可执行文件udevadm的路径,此处替换为该文件的真实路径即可,如果不知道路径, 可以用sudo find / -name "udevadm"
查找。