ganeshmallyap
Posts: 61
Joined: Tue Jun 22, 2021 1:22 pm

Error while updating my Raspberry Pi 4b

Thu Nov 16, 2023 6:12 am

Hello Friends,

Today while updating my Raspberry Pi 4B computer I got the following error. Any guidance on how to fix this error will be very helpful. Kindly let me know if you need any further inputs from my side on this context. Thanks in advance.

Code: Select all

ganeshp@aga-rpi4bsvr:~ $ sudo apt-get update && sudo apt-get upgrade 

Get:1 http://security.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Hit:2 http://deb.debian.org/debian bookworm InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:4 http://security.debian.org/debian-security bookworm-security/main armhf Packages [96.0 kB]
Get:5 http://security.debian.org/debian-security bookworm-security/main arm64 Packages [98.5 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main Translation-en [58.7 kB]
Ign:7 https://download.webmin.com/download/newkey/repository stable InRelease
Get:8 http://archive.raspberrypi.org/debian bookworm InRelease [23.6 kB]
Hit:9 https://download.webmin.com/download/newkey/repository stable Release
Get:11 http://archive.raspberrypi.org/debian bookworm/main arm64 Packages [338 kB]
Get:12 http://archive.raspberrypi.org/debian bookworm/main armhf Packages [346 kB]
Fetched 1,061 kB in 3s (386 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  raspi-firmware
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 4,551 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian bookworm/main arm64 raspi-firmware all 1:1.20231024+ds-1+rpt2 [4,551 kB]
Fetched 4,551 kB in 2s (2,736 kB/s)
Reading changelogs... Done
(Reading database ... 90014 files and directories currently installed.)
Preparing to unpack .../raspi-firmware_1%3a1.20231024+ds-1+rpt2_all.deb ...
Unpacking raspi-firmware (1:1.20231024+ds-1+rpt2) over (1:1.20231024+ds-1+rpt1) ...
Setting up raspi-firmware (1:1.20231024+ds-1+rpt2) ...
Installing new version of config file /etc/kernel/postinst.d/z50-raspi-firmware ...
stat: cannot read file system information for '/boot/firmware': No such file or directory
Error: missing /boot/firmware, did you forget to mount it?
dpkg: error processing package raspi-firmware (--configure):
 installed raspi-firmware package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of rpi-eeprom:
 rpi-eeprom depends on raspi-firmware; however:
  Package raspi-firmware is not configured yet.

dpkg: error processing package rpi-eeprom (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.142) ...
Errors were encountered while processing:
 raspi-firmware
 rpi-eeprom
E: Sub-process /usr/bin/dpkg returned an error code (1)

Cleaning up residual residual files, if any from apt.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up raspi-firmware (1:1.20231024+ds-1+rpt2) ...
stat: cannot read file system information for '/boot/firmware': No such file or directory
Error: missing /boot/firmware, did you forget to mount it?
dpkg: error processing package raspi-firmware (--configure):
 installed raspi-firmware package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of rpi-eeprom:
 rpi-eeprom depends on raspi-firmware; however:
  Package raspi-firmware is not configured yet.

dpkg: error processing package rpi-eeprom (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.142) ...
Errors were encountered while processing:
 raspi-firmware
 rpi-eeprom
E: Sub-process /usr/bin/dpkg returned an error code (1)
Package refresh completed.
Regards
Ganesh

User avatar
B.Goode
Posts: 15876
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Error while updating my Raspberry Pi 4b

Thu Nov 16, 2023 9:16 am

ganeshmallyap wrote:
Thu Nov 16, 2023 6:12 am
Hello Friends,

Today while updating my Raspberry Pi 4B computer I got the following error. Any guidance on how to fix this error will be very helpful. Kindly let me know if you need any further inputs from my side on this context. Thanks in advance.


A couple of related things -

Do you have a specific reason for not performing the update/upgrade in the way recommended in the official Documentation? https://www.raspberrypi.com/documentati ... erry-pi-os


What is the history behind RasPiOS Bookworm being installed on your system? Because the /boot/firmware directory is specifically mentioned in the Release Notes, and I would absolutely expect it to be present in any fresh installation of RasPiOS Bookworm.
Beware of the Leopard

User avatar
rpdom
Posts: 22825
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Error while updating my Raspberry Pi 4b

Thu Nov 16, 2023 10:02 am

These steps should make your broken system usable.

Code: Select all

sudo umount /boot
sudo mkdir /boot/firmware
sudo sed -i "s:boot:boot/firmware:" /etc/fstab
sudo systemctl daemon-reload
sudo mount /boot/firmware
sudo apt -f install
Unreadable squiggle

kapitainsky
Posts: 12
Joined: Wed Jan 26, 2022 1:53 pm

Re: Error while updating my Raspberry Pi 4b

Thu Nov 16, 2023 10:25 am

rpdom wrote:
Thu Nov 16, 2023 10:02 am
These steps should make your broken system usable.

Code: Select all

sudo umount /boot
sudo mkdir /boot/firmware
sudo sed -i "s:boot:boot/firmware:" /etc/fstab
sudo systemctl daemon-reload
sudo mount /boot/firmware
sudo apt -f install
Thank you. Have had the same problem on Bullseye upgraded to Bookworm and it fixed it. All works perfectly.

User avatar
rpdom
Posts: 22825
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Error while updating my Raspberry Pi 4b

Thu Nov 16, 2023 11:01 am

kapitainsky wrote:
Thu Nov 16, 2023 10:25 am
rpdom wrote:
Thu Nov 16, 2023 10:02 am
These steps should make your broken system usable.

Code: Select all

sudo umount /boot
sudo mkdir /boot/firmware
sudo sed -i "s:boot:boot/firmware:" /etc/fstab
sudo systemctl daemon-reload
sudo mount /boot/firmware
sudo apt -f install
Thank you. Have had the same problem on Bullseye upgraded to Bookworm and it fixed it. All works perfectly.
There is no easy upgrade method. You will almost certainly hit other issues later on.
Unreadable squiggle

peatrick
Posts: 1
Joined: Thu Nov 16, 2023 9:24 pm

Re: Error while updating my Raspberry Pi 4b

Thu Nov 16, 2023 9:29 pm

THANK YOU so very much. Have an old Raspberry Pi 3 Model B Plus Rev 1.3 running Pihole and Wireguard VPN, i thought for sure my micro SD card was dying, but struggled to work around or through the issues. This seemed to resolve things immediately, didn't even need to reboot, but I will just to be certain.

Running OS: Raspbian GNU/Linux 12 (bookworm) armv7l, appreciate the guidance and expertise. Stay safe out there!
rpdom wrote:
Thu Nov 16, 2023 10:02 am
These steps should make your broken system usable.

Code: Select all

sudo umount /boot
sudo mkdir /boot/firmware
sudo sed -i "s:boot:boot/firmware:" /etc/fstab
sudo systemctl daemon-reload
sudo mount /boot/firmware
sudo apt -f install

flashydave
Posts: 1
Joined: Fri Nov 17, 2023 2:13 pm

Re: Error while updating my Raspberry Pi 4b

Fri Nov 17, 2023 2:21 pm

This issue appears to be associated with rasperry pi's that have been manually upgraded from an earlier version rather than being flashed with a new (latest) version. I have 4 different rpi's exhibiting the same issue.

Given that many people run mission critical systems or use their pi's in situations where a reinstall is impractical this is an important use case that needs to be addressed by a bug fix to the package update script rather than a manual workaround.

User avatar
B.Goode
Posts: 15876
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Error while updating my Raspberry Pi 4b

Fri Nov 17, 2023 4:41 pm

flashydave wrote:
Fri Nov 17, 2023 2:21 pm
This issue appears to be associated with rasperry pi's that have been manually upgraded from an earlier version rather than being flashed with a new (latest) version. I have 4 different rpi's exhibiting the same issue.

Given that many people run mission critical systems or use their pi's in situations where a reinstall is impractical this is an important use case that needs to be addressed by a bug fix to the package update script rather than a manual workaround.

I don't speak for or on behalf of Raspberry Pi Ltd or their developers, but I would like to think that some careful consideration went into the guidance published as the Blog post that announced the release of RasPiOS :

Ref: https://www.raspberrypi.com/news/bookwo ... rry-pi-os/
We have always said that for a major version upgrade, you should re-image your SD card and start again with a clean image. In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.

This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss. The only way to get Bookworm is either to create an SD card using Raspberry Pi Imager, or to download and flash a Bookworm image from here with your tool of choice.
Beware of the Leopard

bjtheone
Posts: 2745
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Error while updating my Raspberry Pi 4b

Fri Nov 17, 2023 7:42 pm

and the standard adder to the official recommendation from RPL that if you have to ask how, you really should do the clean/fresh install.

The longer answer is yes an in-place upgrade can be done. There are significant changes between Bullseye and Bookworm that you are going to have to deal with to get a truly well installed Bookworm. There are hacks to get a functional Bookworm.

For example they grew /boot. You don't need the space right now but the new process will end up using more space and running with a smaller /boot partition may come back to bite you. You certainly can move stuff around and grow partitions but is is not super simple to do. They now have the boot files in /boot/firmware. An easy fix but any old install scripts may step on the symbolic links.

Then there is the behaviour of an release upgraded system is going to be different that a fresh install. Some of these changes may come back to bite you and folks offering Bookworm based solutions and advice are going to assume the behaviour of a "standard" Bookworm install.

The last issue is that a fresh install plus adding in your "stuff" is likely a deterministic amount of time. The in-place upgrade may go reasonably well, if you have a very stock OS install, or may horribly break. The more custom/tweaked your install is, the more likely you will trend to horribly break. The worse it breaks, the longer it will take to resolve. The lowlihood that the in-place install will take less time that a fresh install + additions is low.

Assess the risks and make the decision that makes the most sense to you.

ganeshmallyap
Posts: 61
Joined: Tue Jun 22, 2021 1:22 pm

Re: Error while updating my Raspberry Pi 4b

Sat Nov 18, 2023 3:05 am

B.Goode wrote:
Thu Nov 16, 2023 9:16 am
ganeshmallyap wrote:
Thu Nov 16, 2023 6:12 am
Hello Friends,

Today while updating my Raspberry Pi 4B computer I got the following error. Any guidance on how to fix this error will be very helpful. Kindly let me know if you need any further inputs from my side on this context. Thanks in advance.


A couple of related things -

Do you have a specific reason for not performing the update/upgrade in the way recommended in the official Documentation? https://www.raspberrypi.com/documentati ... erry-pi-os


What is the history behind RasPiOS Bookworm being installed on your system? Because the /boot/firmware directory is specifically mentioned in the Release Notes, and I would absolutely expect it to be present in any fresh installation of RasPiOS Bookworm.
@B.Goode, sincere thanks for your time and attention. I have noted your points. Going forward I shall use only the recommended method to run the daily update.

I use my Raspberry Pi 4b 8gb SBC as my home server with only console installation(No GUI) with with loads and loads of server services such as Apache2, MariaDB, PiHole, Unbound, Samba, OpenSSH, SSHFS, Wireguard vpn, Fail2ban, NFS, Webmin, and a few more for past 2+ years and it has been working like magic. Never faced any serious issues so far.

I upgraded my OS sometime back by manually editing file /etc/apt/sources.list. I had replaced bullseye with bookworm and then changed non-free repo to non-free-firmware. Upgrade went through fine with some minor warnings. Only reason why I avoided flashing of fresh ISO image, was to avoid reinstalling and configuring huge number of applications as listed in the above para, I have written a long script to manage most of the basic package installation , but configuration part, currently doing manually. Yet to figure out how to improvise the script to make it flawless.

Regards
Ganesh

ganeshmallyap
Posts: 61
Joined: Tue Jun 22, 2021 1:22 pm

Re: Error while updating my Raspberry Pi 4b

Sat Nov 18, 2023 3:07 am

rpdom wrote:
Thu Nov 16, 2023 10:02 am
These steps should make your broken system usable.

Code: Select all

sudo umount /boot
sudo mkdir /boot/firmware
sudo sed -i "s:boot:boot/firmware:" /etc/fstab
sudo systemctl daemon-reload
sudo mount /boot/firmware
sudo apt -f install
@rpdom, First of all, thank you so much for your time and attention to my post. Steps indicated by you have worked perfectly... I cant thank you enough!!! You have a great day.

Here is the output of the above commands -

Code: Select all

ganeshp@aga-rpi4bsvr:~ $ sudo umount /boot
ganeshp@aga-rpi4bsvr:~ $ sudo mkdir /boot/firmware
ganeshp@aga-rpi4bsvr:~ $ sudo sed -i "s:boot:boot/firmware:" /etc/fstab
ganeshp@aga-rpi4bsvr:~ $ sudo systemctl daemon-reload
ganeshp@aga-rpi4bsvr:~ $ sudo mount /boot/firmware
ganeshp@aga-rpi4bsvr:~ $ sudo apt -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up raspi-firmware (1:1.20231024+ds-1+rpt2) ...
Setting up rpi-eeprom (20.1-2) ...
Processing triggers for initramfs-tools (0.142) ...

ganeshp@aga-rpi4bsvr:~ $ sudo apt update && sudo apt full-upgrade
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://security.debian.org/debian-security bookworm-security InRelease       
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease                      
Hit:4 http://archive.raspberrypi.org/debian bookworm InRelease                     
Ign:5 https://download.webmin.com/download/newkey/repository stable InRelease
Hit:6 https://download.webmin.com/download/newkey/repository stable Release
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
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.
Regards
Ganesh

Return to “Troubleshooting”