Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

apt upgrade fails on libraspberrypi0 dependency hell

Sat Mar 20, 2021 12:30 am

I went to do a 20 minute install / configure of a new app on my RPI 4b and TWO FULL DAYS of reading 50+ pages of "stuff", and trying dozens of "fixes" (that aren't), I'm still trying to get an upgrade of Raspberry OS to work so I can go live life again.

The current version 20210308-1 libraspberrypi0 module won't install because it requires bootloader version 20210308-1. My Raspberry Pi OS has bootloader 20200903 and for the life of me, I can't get the bootloader to update to the 20210308-1 version. (much less stay there through the cycle of a "full-upgrade" on the other 67 "upgradable" modules that are ready for an upgrade.

There may be more traps awaiting in my version of the 7-layers of dependency hell, but I won't see them until I can get past this one.

Given that the RELEASED version of libraspberrypi0 MUST have the same release date code (20210308-1), one would think that this major inability to complete an apt upgrade would be ringing alarm bells everywhere, but I sure can't find out.

No amount of "fix-broken install" stuff for libraspberrypi0 broken install works. I have use a blank SD card and the RPI-Imager utility to flash version 20210308-1 bootloader, used that SD card to boot (which supposedly updates the EEPROM with what's on the SD Card ... ). By the time I boot back up to my production SD Card, the bootloader is again at the Sept 3, 2020 version.

Has anybody figured out how to actually get past this version incompatibility?
I really don't want to start from scratch and re-setup a completely new install, but at this point, that would've have saved me a full day of wasted time trying to troubleshoot.

Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

Re: apt upgrade fails on libraspberrypi0 dependency hell

Tue May 04, 2021 2:19 am

Continuation (re-post) of my March 19 post on this thread: I still cannot get the Raspberry OS to complete an update because it says I have a broken installation of the module "libraspberrypi0" (current version 20210308-1 libraspberrypi0 module) won't install because it requires bootloader version 20210308-1. My Raspberry Pi OS has bootloader 20200903 and for the life of me, I can't get the bootloader to update to the 20210308-1 version.

Nor can I un-install or repair the broken install of libraspberrypi0 to revert to an older version that isn't dependent on bootloader version 20210308-1.

I have downloaded the Bootloader rescue from Raspberry Pi site and flashed it to a different SD Card, rebooted with that card -- no difference when I went back to my "production" SD Card.

Is anybody else locked into this OS Update catch-22? Any ideas how to force libraspberrypi0 to revert to an older version? Or to actually get an EPROM update of the Bootloader to stick?

I've invested in this Raspberry device and would like to actually use it instead of depending on my Arduino for everything.

User avatar
craigevil
Posts: 376
Joined: Wed Jan 27, 2021 5:22 am
Location: heaven

Re: apt upgrade fails on libraspberrypi0 dependency hell

Tue May 04, 2021 4:47 am

sudo raspi-config

Advance >Bootloader> Latest

reboot.
Should give you:

Code: Select all

BOOTLOADER: up to date
   CURRENT: Thu 29 Apr 2021 04:11:25 PM UTC (1619712685)
    LATEST: Thu 29 Apr 2021 04:11:25 PM UTC (1619712685)
   RELEASE: stable (/lib/firmware/raspberrypi/bootloader/stable)
            Use raspi-config to change the release.

  VL805_FW: Using bootloader EEPROM
     VL805: up to date
   CURRENT: 000138a1
    LATEST: 000138a1
BOOTLOADER: up to date
   CURRENT: Thu 29 Apr 2021 04:11:25 PM UTC (1619712685)
    LATEST: Thu 29 Apr 2021 04:11:25 PM UTC (1619712685)
   RELEASE: stable (/lib/firmware/raspberrypi/bootloader/stable)
            Use raspi-config to change the release.

  VL805_FW: Using bootloader EEPROM
     VL805: up to date
   CURRENT: 000138a1
    LATEST: 000138a1
You can also try doing:
sudo apt update
sudo apt upgrade
Raspberry PI 400 Raspberry Pi OS (Debian Sid) Kernel: 5.15.41-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

Re: apt upgrade fails on libraspberrypi0 dependency hell

Thu May 06, 2021 10:04 pm

Thank you for your reply! I again tried what you recommended with the rpi-eprom-update command. It still did nothing - I'm still on the 03 September 2020 Bootloader version, and my system still shows that Jan 16 2021 is the "latest" Bootloader.

I can't get any sort of apt repo "upgrade" processes to run to completion because it just errors out telling me that the package libraspberrypi0 is not completely installed due to this dependency catch-22. None of the usual CLI commands to force install or un-install are working -- all just error out in the same way (dpkg etc.). I tried the Synaptic Pkg manager which is usually pretty good at cleaning up broken installs, and even that errors out.
An apt --fix-broken install command errors out with an error checking '/boot/start/elf' read-only file system Here's more detail of the failure:

Code: Select all

Reading changelogs... Done
(Reading database ... 175266 files and directories currently installed.)
Preparing to unpack .../raspberrypi-bootloader_1.20210303-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.20210303-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.20210303-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I think I have to somehow clobber libraspberrypi0 by deleting files etc. to see if I can get any sort of "upgrade" to actually run to completion.
Or maybe just re-download the OS onto a different SD card, boot that up to get the latest bootloader into EEPROM, then go back to my production OS on the existing SD card to see if I can get past this problem that has completely constipated any sort of "update".

User avatar
craigevil
Posts: 376
Joined: Wed Jan 27, 2021 5:22 am
Location: heaven

Re: apt upgrade fails on libraspberrypi0 dependency hell

Fri May 07, 2021 12:18 am

Try doing:
sudo apt update
sudo apt full-upgrade
sudo apt -f install
Raspberry PI 400 Raspberry Pi OS (Debian Sid) Kernel: 5.15.41-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

Re: apt upgrade fails on libraspberrypi0 dependency hell

Fri May 07, 2021 2:01 am

Hi ! Thank you for your reply.
As previously noted, any kind of apt "upgrade" command fails, so doing a "full upgrade" fails. Every time as it has since early March.

What I've done this afternoon is created a new Raspberry OS image on a different SD card, booted to that, then installed the April 29 version of the bootloader into the EEPROM. ... progress, I'd hoped

When I went back to my production SD card, the system booted just fine with the updated bootloader, but the operating system doesn't know / doesn't recognize that the bootloader is updated --- it still thinks that the "latest" available update of the bootloader is January 8, 2021. Which is not new enough to keep the "apt upgrade" or apt full-upgrade from terminating with an error.

I know somewhere there is a config / text file that has a list of the available versions in stable and beta. I found it weeks ago, but can't find it again to manually update it so that my system will stop thinking that the bootloader is the January version when in fact, it is the April 29 version. I'm kind of surprised that the raspberry OS doesn't even have the ability to auto-detect which bootloader version is running. Perhaps the OS has to see a pieeprom <date>.bin file for the April 29 release in /lib/firmware/raspberrypi/bootloader/beta (or stable) before it makes any assumptions about what is actually installed as a bootloader on the EEPROM. Very crude implementation IMHO

Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

Re: apt upgrade fails on libraspberrypi0 dependency hell

Fri May 07, 2021 10:24 pm

OK - update to the saga of this seemingly impossible catch-22

I have updated my Pi's EEPROM to the latest (4/29/2021) bootloader. I did this by creating a fresh new OS on a different SD Card, then booting to that OS where I could get apt updates to run and was able to manually update the EEPROM with the latest bootloader.

I also copied all of the bootloader .bin files at /lib/firmware/raspberrypi/bootloader from the new fresh OS to my production OS SD Card. However, after rebooting to my production OS, the Pi system STILL does not recognize that the latest bootloader is installed. You can see below that it thinks bootloader version 20210108 is installed, but the next command "rpi-eeprom-update" confirms that the latest April 29 version is installed.

Code: Select all

pi@raspberrypi:/boot $ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
181 packages can be upgraded. Run 'apt list --upgradable' to see them.
pi@raspberrypi:/boot $ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.  [NB:  this does not work - errors out on read-only /boot/start.elf  file]
The following packages have unmet dependencies:
 libraspberrypi0 : Depends: raspberrypi-bootloader (= 1.20210430-1) but 1.20210108-1 is installed  [see below - 1.20210429 is installed]
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

pi@raspberrypi:/boot $ sudo rpi-eeprom-update
BCM2711 detected
Dedicated VL805 EEPROM detected
BOOTLOADER: up-to-date
CURRENT: Thu 29 Apr 2021 04:11:25 PM UTC (1619712685)
 LATEST: Thu 29 Apr 2021 04:11:25 PM UTC (1619712685)
 FW DIR: /lib/firmware/raspberrypi/bootloader/stable
VL805: up-to-date
I have not yet been able to find out how to get the Raspberry Pi OS to actually probe the system EEPROM and see that the latest bootloader is indeed installed. Somewhere, there must be a config file that is out-of-sync with reality, but I have not been able to find it.

If anybody has any idea how to force the OS to correctly recognize the installed bootloader version, that might help me restore the ability to run an apt upgrade (or any of it's derivatives" and have it actually run to completion.

Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

Re: apt upgrade fails on libraspberrypi0 dependency hell

Sun May 09, 2021 9:09 pm

Hi All -
Still trying to find out why my Raspberry Pi OS thinks that bootloader Firmware Version Jan21, 2021 is installed in the EEPROM when in fact the EEPROM has bootloader version Apr 29, 2021.

Because of this mis-reported bootloader version to apt and dpkg functions, I can't get rid of a dependency abort on ANY attempts to "update" the system using apt, apt-get, dpkg, forced install, reinstall bootloader or reinstall libraspberrypi0 (the pkg with the dependency on latest bootloader).

Does anyone know of a hidden configuration file that I can update manually to align the OS / apt upgrade dependency-check tree with the reality of what is actually installed in my RaspberryPi 4b EEPROM?

Basically, I need to clobber the broken dependency tree that gets built now, and have it built where it shows the correct version of the bootloader so that the upgrade doesn't abort every time for any derivative of apt upgrade commands.

Still hoping to get some responses ... this dependency issue was reported in 2015 and 2016, but those threads have nothing that is working for me.

RonR
Posts: 2772
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: apt upgrade fails on libraspberrypi0 dependency hell

Mon May 10, 2021 1:12 am

@Greygeek,

I think you're (not surprisingly) getting tangled up between two different applications of the term 'bootloader'.

The Raspberry Pi 4B has bootloader software residing in an EEPROM (prior to the Raspberry Pi 4B, it was embedded in the SoC and couldn't be changed). The latest version of software for the bootloader EEPROM is dated 2021-04-29 and can be verified and updated if necessary with Raspberry Pi EEPROM Manager.

All Raspberry Pi's have a set of files in the /boot directory that are usually called 'firmware' but are packaged as raspberrypi-bootloader.

The bootloader EEPROM software loads files from the /boot directory, turns control over to them, and the bootloader EEPROM is of no further use.

The complaints you're seeing from apt apply to the 'bootloader' files residing in /boot, not to the bootloader EEPROM software.

Have you tried running the following?:

Code: Select all

sudo apt --reinstall install raspberrypi-kernel
sudo apt --reinstall install raspberrypi-bootloader

If successful, a reboot is required.

Greygeek
Posts: 7
Joined: Fri Mar 19, 2021 8:24 pm

Re: apt upgrade fails on libraspberrypi0 dependency hell

Thu Jun 10, 2021 2:45 am

Hello RonR! Well here we are, a month after your thoughtful reply.
I've had too many other things going on to keep troubleshooting the Raspberry Pi OS.
During the two+ months I was trying to get the danged thing to update, I did go through the process to update the contents of the EEPROM on the Raspberry 4B board, (using a fresh image of Raspberry OS on a different SD card) and I also tried to replace the files in the /boot directory.

Nothing helped. The entire "sudo apt xxxx" command system is just plain broken on my "production" Raspberry Pi OS SD-Cars. It will always get hung up on some mixture of "read only file directories" or this version dependency catch-22 between the bootloader and a key OS module libraspberrypi0. It will never finish any derivative of an apt install, apt uninstall, apt reinstall etc. etc. nor will it complete any version of a dpkg command that I would issue to try and install or uninstall anything, throwing out the notoriously broad "dpkg returned Error 1" which could mean anything from a bad CPU to a failure to achieve World peace.

When I get time, I will back up files I want to transfer then I will nuke the contents of my SD card with a complete fresh image of a Linux distro and start completely over. Not sure I will again try the Raspberry OS after this experience. I use MX Linux on other devices, and they've now got a version for Raspberry, so I may go that route given how solid MX Linux has been for me in recent years.

Thank you again. I'm sorry I did not see your response until today.
B

Return to “Troubleshooting”