메모

메모

Ubuntu 21.10 서버를 실행하는 Raspberry Pi Zero W 2에 WiFi를 설치하고 구성했습니다. 나는 실행 apt update한 다음 apt upgrade아래 출력을 사용했습니다. 새 보드이고 새로 설치한 것이므로 무슨 일이 일어나고 있는지 전혀 확신할 수 없습니다.

sudo apt upgrade:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up initramfs-tools (0.140ubuntu6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.201.1) ...
update-initramfs: Generating /boot/initrd.img-5.13.0-1008-raspi
Killed
E: mkinitramfs failure zstd -q -19 -T0 137
update-initramfs: failed for /boot/initrd.img-5.13.0-1008-raspi with 1.
dpkg: error processing package linux-firmware (--configure):installed linux-firmware package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-raspi:
 linux-image-raspi depends on linux-firmware; however:
  Package linux-firmware is not configured yet.
dpkg: error processing package linux-image-raspi (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-5.13.0-1011-raspi (5.13.0-1011.13) ...
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-raspi:
 linux-raspi depends on linux-image-raspi (= 5.13.0.1011.17); however:
  Package linux-image-raspi is not configured yet.
dpkg: error processing package linux-raspi (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for initramfs-tools (0.140ubuntu6) ...
update-initramfs: Generating /boot/initrd.img-5.13.0-1008-raspi
Killed
E: mkinitramfs failure zstd -q -19 -T0 137
update-initramfs: failed for /boot/initrd.img-5.13.0-1008-raspi with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
Processing triggers for linux-image-5.13.0-1011-raspi (5.13.0-1011.13) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.13.0-1011-raspi
Killed
E: mkinitramfs failure zstd -q -19 -T0 137
update-initramfs: failed for /boot/initrd.img-5.13.0-1011-raspi with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.13.0-1011-raspi (--configure):
 installed linux-image-5.13.0-1011-raspi package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 linux-firmware
 linux-image-raspi
 linux-raspi
 initramfs-tools
 linux-image-5.13.0-1011-raspi
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

답변1

64비트 Ubuntu Server 21.10을 사용하는 Pi Zero 2에서도 동일한 문제가 발생했습니다. 스왑 파일을 활성화하지 않으면 업데이트 프로세스에서 메모리가 부족해질 수 있습니다.

스왑 파일 생성 예 -

sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab

참조:https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-20-04/

답변2

시스템이 엉망이 되었습니다. 새로 설치한 경우에는 이 문제가 발생하지 않기 때문에 새로 설치한 것인지 의심스럽습니다. 어쨌든 첫 번째 선택으로 다시 설치하는 것이 좋습니다. 하지만 그렇게 할 수 없는 경우 여기에 도움이 될 수 있는 답변이 있습니다. 이러한 오류에서 벗어나십시오.

메모

  • 그래요모든 솔루션 뒤에 "*" 표시아마도 효과가 있을 것입니다.

짧은 답변 *

간단한 패키지 제거 및 재설치:-

다음과 같은 방법으로 패키지를 제거할 수 있습니다.

$ sudo dpkg --remove --force-remove-reinstreq linux-firmware
$ sudo dpkg --remove --force-remove-reinstreq linux-image-raspi
$ sudo dpkg --remove --force-remove-reinstreq linux-raspi
$ sudo dpkg --remove --force-remove-reinstreq initramfs-tools
$ sudo dpkg --remove --force-remove-reinstreq linux-image-5.13.0-1011-raspi
$ sudo apt-get -f install

그런 다음 다시 설치하세요.

sudo apt-get install linux-firmware linux-image-raspi linux-raspi initramfs-tools  linux-image-5.13.0-1011-raspi

고급 솔루션:-

강제 설치를 사용합니다. *

일반적으로 apt -f install작품을 사용합니다!
달리다:

sudo apt -f install

오류가 수정되었다면 축하합니다. 그렇지 않다면 계속 진행하세요.

조금 앞서가는 중 *

apt이 문제를 해결하려면 캐시 파일을 지워야 할 수도 있습니다 . 일반적으로 어떤 식으로든 OS에 해를 끼치지 않습니다.
당신은 실행할 수 있습니다

sudo rm -rf /var/cache/apt/archives/*.deb

아마도 오류가 수정될 것입니다! 그렇지 않은 경우 계속 진행하십시오.

또 다른 솔루션.

이것도 시도해 볼 수 있습니다 -

sudo -E apt-get install aptitude
sudo -E aptitude safe-upgrade
sudo -E aptitude dist-upgrade

이후

mkdir ~/debs
cd ~/debs
ls
sudo apt download linux-firmware linux-image-raspi linux-raspi initramfs-tools  linux-image-5.13.0-1011-raspi

sudo dpkg -i --force-all ./*.deb

패키지를 제거하고 다시 설치합니다.

다음과 같은 방법으로 패키지를 제거할 수 있습니다.

$ sudo dpkg --remove --force-remove-reinstreq linux-firmware
$ sudo dpkg --remove --force-remove-reinstreq linux-image-raspi
$ sudo dpkg --remove --force-remove-reinstreq linux-raspi
$ sudo dpkg --remove --force-remove-reinstreq initramfs-tools
$ sudo dpkg --remove --force-remove-reinstreq linux-image-5.13.0-1011-raspi
$ sudo apt-get -f install

그런 다음 다시 설치하세요.

sudo apt-get install linux-firmware linux-image-raspi linux-raspi initramfs-tools  linux-image-5.13.0-1011-raspi

마지막 옵션 *

마지막 옵션으로 오류 패키지의 설치 후 파일을 제거해 볼 수 있습니다. 이렇게 해도 오류가 해결되지는 않지만 시스템은 오류를 무시합니다.

cd /var/lib/dpkg/info/
mkdir ~/backup
mv linux-firmware ~/backup
mv linux-image-raspi ~/backup
mv linux-raspi ~/backup
mv initramfs-tools ~/backup
mv linux-image-5.13.0-1011-raspi ~/backup

sudo apt -f install

효과가 있었나요?

작동하지 않으면 행운이 없습니다.이 명령이 작동하지 않으면 시스템이 이전보다 더 엉망이 된 것입니다.. 말씀하신 대로 새로 설치한 것이므로 우분투를 다시 설치하면 됩니다.

관련 정보