I run sudo apt update
and sudo apt upgrade
every month on my pi.
A couple weeks back this occurred during the upgrade part.
> pi@ngpi:/var/log $ sudo apt upgrade Reading package lists... Done
> Building dependency tree Reading state information... Done You
> might want to run 'apt --fix-broken install' to correct these. The
> following packages have unmet dependencies: libraspberrypi0 :
> Depends: raspberrypi-bootloader (= 1.20200902-1) but 1.20200819-1 is
> installed E: Unmet dependencies. Try 'apt --fix-broken install' with
> no packages (or specify a solution).
I did a bunch of debug and it appears the /boot file system is read only even though mount reports is as rw. How do I fix this?
I tried sudo apt --fix-broken install
and get this error
pi@ngpi:/var/log $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
raspberrypi-bootloader
The following packages will be upgraded:
raspberrypi-bootloader
1 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
17 not fully installed or removed.
Need to get 0 B/4,543 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 153773 files and directories currently installed.)
Preparing to unpack .../raspberrypi-bootloader_1.20200902-1_armhf.deb ...
Adding 'diversion of /boot/start.elf to /usr/share/rpikernelhack/start.elf by rpikernelhack'
dpkg-divert: error: error checking '/boot/start.elf': Read-only file system
dpkg: error processing archive /var/cache/apt/archives/raspberrypi-bootloader_1.20200902-1_armhf.deb (--unpack):
new raspberrypi-bootloader package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/raspberrypi-bootloader_1.20200902-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've tried a fix-install for raspberrypi-bootloader ad libraspberrypi0 to no avail.
More info: Linux ngpi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux Model : Raspberry Pi 3 Model B Rev 1.2 Debian ver: 10.4
Thoughts?
Based on more research, I tried this:
sudo apt install libraspberrypi0 raspberrypi-bootloader
Results:
pi@ngpi:/var/log $ sudo apt install libraspberrypi0 raspberrypi-bootloader
Reading package lists... Done
Building dependency tree
Reading state information... Done
libraspberrypi0 is already the newest version (1.20200902-1).
The following packages will be upgraded:
raspberrypi-bootloader
1 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
17 not fully installed or removed.
Need to get 0 B/4,543 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 153773 files and directories currently installed.)
Preparing to unpack .../raspberrypi-bootloader_1.20200902-1_armhf.deb ...
Adding 'diversion of /boot/start.elf to /usr/share/rpikernelhack/start.elf by rpikernelhack'
dpkg-divert: error: error checking '/boot/start.elf': Read-only file system
dpkg: error processing archive /var/cache/apt/archives/raspberrypi-bootloader_1.20200902-1_armhf.deb (--unpack):
new raspberrypi-bootloader package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/raspberrypi-bootloader_1.20200902-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Here is the pertinent part. Why would the boot file system be read-only?
Preparing to unpack .../raspberrypi-bootloader_1.20200902-1_armhf.deb ...
Adding 'diversion of /boot/start.elf to /usr/share/rpikernelhack/start.elf by rpikernelhack'
dpkg-divert: error: error checking '/boot/start.elf': Read-only file system
I ran sudo mount -o remount, rw /
and see this in /var/log/messages
Oct 22 22:03:37 ngpi kernel: [1762400.628213] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
and this running mount
: /dev/mmcblk0p2 on / type ext4 (rw,noatime)
but re-running sudo apt install libraspberrypi0 raspberrypi-bootloader
gives
the same read-only file system error. A restart did not fix anything.