如何修复 Raspberry 上的这个 Debian 更新错误(执行期间遇到错误)?

如何修复 Raspberry 上的这个 Debian 更新错误(执行期间遇到错误)?

当我尝试升级 Raspberry 机器时出现此错误:

Debian 10.2—带有 HDE 启动的树莓派机器。

    Après cette opération, 96,7 Mo d'espace disque supplémentaires seront utilisés.
    Souhaitez-vous continuer ? [O/n] O
    Lecture des fichiers de modifications (« changelog »)... Terminé
    Extraction des modèles depuis les paquets : 100%
    Préconfiguration des paquets...
    Paramétrage de libbz2-1.0:armhf (1.0.6-9.2~deb10u1) ...
    (Lecture de la base de données... 153233 fichiers et répertoires déjà installés.)
    Préparation du dépaquetage de .../raspberrypi-kernel_1.20190925+1-1_armhf.deb ...
    Ajout de « détournement de /boot/kernel.img en /usr/share/rpikernelhack/kernel.img par rpikernelhack »
    dpkg-divert: erreur: erreur lors de la vérification de « /boot/kernel.img »: Système de fichiers accessible en lecture seulement
    dpkg: erreur de traitement de l'archive /var/cache/apt/archives/raspberrypi-kernel_1.20190925+1-1_armhf.deb (--unpack) :
     new raspberrypi-kernel package pre-installation script subprocess returned error exit status 2
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75+ /boot/kernel.img
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75-v7+ /boot/kernel7.img
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75-v7l+ /boot/kernel7l.img
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75-v8+ /boot/kernel8.img
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.57+ /boot/kernel.img
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.57+ /boot/kernel.img
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.57-v7+ /boot/kernel7.img
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.57-v7+ /boot/kernel7.img
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.57-v7l+ /boot/kernel7l.img

run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.57-v7l+ /boot/kernel7l.img
Préparation du dépaquetage de .../libncurses6_6.1+20181013-2+deb10u2_armhf.deb ...
Dépaquetage de libncurses6:armhf (6.1+20181013-2+deb10u2) sur (6.1+20181013-2) ...
Préparation du dépaquetage de .../libtinfo6_6.1+20181013-2+deb10u2_armhf.deb ...
Dépaquetage de libtinfo6:armhf (6.1+20181013-2+deb10u2) sur (6.1+20181013-2) ...
Des erreurs ont été rencontrées pendant l'exécution :
 /var/cache/apt/archives/raspberrypi-kernel_1.20190925+1-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

翻译谷歌翻译

After this operation, 96.7 MB of additional disk space will be used.
    Would you like to continue ? [Y / n] Y
    Reading change files ("changelog") ... Done
    Extraction of models from packages: 100%
    Preconfiguration of packages ...
    Parameterization of libbz2-1.0: armhf (1.0.6-9.2 ~ deb10u1) ...
    (Reading the database ... 153233 files and directories already installed.)
    Preparing the unpacking of .../raspberrypi-kernel_1.20190925+1-1_armhf.deb ...
    Added "hijacking of /boot/kernel.img to /usr/share/rpikernelhack/kernel.img by rpikernelhack"
    dpkg-divert: error: error checking "/boot/kernel.img": read-only file system
    dpkg: archive processing error /var/cache/apt/archives/raspberrypi-kernel_1.20190925+1-1_armhf.deb (--unpack):
     new raspberrypi-kernel pre-installation script package subprocess returned error exit status 2
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75+ /boot/kernel.img
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75-v7+ /boot/kernel7.img
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75-v7l+ /boot/kernel7l.img
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.19.75-v8+ /boot/kernel8.img
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.57+ /boot/kernel.img
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.57+ /boot/kernel.img
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.57-v7+ /boot/kernel7.img
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.57-v7+ /boot/kernel7.img
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.57-v7l+ /boot/kernel7l.img

run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.57-v7l+ /boot/kernel7l.img
Preparing the unpacking of .../libncurses6_6.1+20181013-2+deb10u2_armhf.deb ...
Unpacking of libncurses6: armhf (6.1+20181013-2+deb10u2) on (6.1+20181013-2) ...
Preparing the unpacking of .../libtinfo6_6.1+20181013-2+deb10u2_armhf.deb ...
Unpacking of libtinfo6: armhf (6.1+20181013-2+deb10u2) on (6.1+20181013-2) ...
Errors were encountered during execution:
 /var/cache/apt/archives/raspberrypi-kernel_1.20190925+1-1_armhf.deb
E: Subprocess /usr/bin/dpkg returned an error code (1)

我该如何解决这个错误?

答案1

解决:

确实,正如 EchoMike444 提到的,这是因为 /boot 文件夹是只读的。

实际上,我的系统在 HDD 上启动,但 /boot 文件夹仍保留在 SD 卡的一个分区上。

这里的问题来自 fstab 文件(在 HDD - /etc/fstab 中),包含 /boot 文件夹的分区是 ro(只读)...

相关内容