"update-initramfs: /boot/initrd.img-5.4.0-92-generic 생성 중"에서 멈춤

"update-initramfs: /boot/initrd.img-5.4.0-92-generic 생성 중"에서 멈춤

내 서버(20.04 LTS)에서 패키지를 제거하는 데 문제가 있습니다.

실행하면 apt remove metricbeat다음 메시지가 나타납니다.

root@elk:/home/elk# apt remove metricbeat
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  metricbeat
0 upgraded, 0 newly installed, 1 to remove and 183 not upgraded.
1 not fully installed or removed.
After this operation, 182 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 151385 files and directories currently installed.)
Removing metricbeat (7.16.2) ...
Setting up linux-image-5.4.0-92-generic (5.4.0-92.103) ...
Processing triggers for linux-image-5.4.0-92-generic (5.4.0-92.103) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-92-generic

Progress: [ 80%] [############################################.......] 

이 단계에서 멈춰서 ctrl+c ctrl+z가 작동하지 않았습니다. 다른 SSH 연결을 열고 다시 실행하면 apt remove metricbeat다음 메시지가 나타납니다.

^Citing for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1890890 (apt)... 1s

나는 적절한 PID를 발견 ps -aux | grep apt 하고 죽였습니다. 그런 다음 지금 다시 제거 명령을 실행하십시오.

root@elk:/home/elk# apt remove metricbeat
^Citing for cache lock: Could not get lock /var/lib/dpkg/lock. It is held by process 1891272 (dpkg)... 1s

dpkg 실행 프로세스:

root     1891272  0.0  0.0  11136  5328 ?        Ss   14:47   0:00 /usr/bin/dpkg --status-fd 42 --configure --pending
root     1891282  0.0  0.0   2608   608 ?        S    14:47   0:00 /bin/sh /var/lib/dpkg/info/linux-image-5.4.0-92-generic.postinst triggered linux-update-5.4.0-92-generic

해당 프로세스를 종료한 후 다시 패키지 제거 명령을 실행하고 다음을 얻습니다.

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

그래서 나는 달렸고 sudo dpkg --configure -a이 단계에서 멈췄습니다.

root@elk:/home/elk# dpkg --configure -a
Setting up linux-image-5.4.0-92-generic (5.4.0-92.103) ...
Processing triggers for linux-image-5.4.0-92-generic (5.4.0-92.103) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-92-generic

Ctrl+C로:

error processing package linux-image-5.4.0-92-generic (--configure):
 installed linux-image-5.4.0-92-generic package post-installation script subprocess was interrupted
Errors were encountered while processing:
 linux-image-5.4.0-92-generic

/boot를 확인했습니다.

root@elk:/boot# ls -lh
total 218M
-rw-r--r-- 1 root root 233K Apr 20  2020 config-5.4.0-26-generic
-rw-r--r-- 1 root root 233K Nov  5 16:02 config-5.4.0-91-generic
-rw-r--r-- 1 root root 233K Nov 26 14:42 config-5.4.0-92-generic
drwxr-xr-x 4 root root 4.0K Apr  9 08:14 grub
lrwxrwxrwx 1 root root   27 Apr  9 08:14 initrd.img -> initrd.img-5.4.0-92-generic
-rw-r--r-- 1 root root  78M Feb 15  2021 initrd.img-5.4.0-26-generic
-rw-r--r-- 1 root root  81M Dec  9 06:37 initrd.img-5.4.0-91-generic
-rw-r--r-- 1 root root    0 Apr  9 14:58 initrd.img-5.4.0-92-generic.new
lrwxrwxrwx 1 root root   27 Jan  5 06:48 initrd.img.old -> initrd.img-5.4.0-91-generic
-rw------- 1 root root 4.6M Apr 20  2020 System.map-5.4.0-26-generic
-rw------- 1 root root 4.6M Nov  5 16:02 System.map-5.4.0-91-generic
-rw------- 1 root root 4.6M Nov 26 14:42 System.map-5.4.0-92-generic
lrwxrwxrwx 1 root root   24 Jan  5 06:48 vmlinuz -> vmlinuz-5.4.0-92-generic
-rw------- 1 root root  12M Apr 20  2020 vmlinuz-5.4.0-26-generic
-rw------- 1 root root  12M Nov  5 16:04 vmlinuz-5.4.0-91-generic
-rw------- 1 root root  14M Nov 26 14:45 vmlinuz-5.4.0-92-generic
lrwxrwxrwx 1 root root   24 Jan  5 06:48 vmlinuz.old -> vmlinuz-5.4.0-91-generic
root@elk:/boot# 

문제가 있는 것 같은데 initrd.img-5.4.0-92-generic어떻게 해결해야 할지 모르겠습니다. 이 사이클은 계속해서 일어났습니다.

답변1

얼마나 오래 기다리고 계십니까? 나는 이 작업이 수행되는 동안 몇 분 동안 기다려야 했다는 것을 알고 있습니다 update-initramfs: Generating /boot/initrd.img. 커피를 마시고 TV가 도착하면 시청해 보세요.

답변2

update-initramfs어떤 모듈에서 멈췄는지 확인하려면 상세 모드에서 실행해 보세요 .

update-initramfs -v -u

또는 ps현재 실행 중인 후크를 표시할 수도 있습니다.

ps f | grep initram
  24830 pts/1    S+     0:00          \_ /bin/sh -e /etc/kernel/postinst.d/initramfs-tools 4.19.0-21-amd64 /boot/vmlinuz-4.19.0-21-amd64
  24832 pts/1    S+     0:00              \_ /bin/sh /usr/sbin/update-initramfs -c -k 4.19.0-21-amd64 -b /boot
  24834 pts/1    S+     0:00                  \_ /bin/sh /usr/sbin/mkinitramfs -o /boot/initrd.img-4.19.0-21-amd64.new 4.19.0-21-amd64
  28372 pts/1    S+     0:00                      \_ /bin/sh /usr/share/initramfs-tools/hooks/mdadm

관련 정보