Posts: 58
Joined: Tue Jul 31, 2012 7:25 pm

apt-get upgrade broke on kernel-update

Tue Nov 06, 2012 10:14 pm

Hello RPi Forum,

my Pi is running Raspbian. Today I ran apt-get upgrade, which updated a lot of packages including the kernel. While setting up that kernel package, it hung completely when doing something with redirects (sorry, I don't remember the exact message). I couldn't start another ssh session (headless Pi), no login prompt. After an hour, I pulled the power supply and tried a reboot, which failed with only the red LED lighting up, no other activity. With the SD card in my Win7 PC, I found that "bootcode.bin" had been renamed, so renaming it back to "bootcode.bin" made my Pi boot again.

Next try with apt-get upgrade gave me an error message telling me to run "dpkg --configure -a". Doing this restarted the setup of the kernel package, resulting in the same hang as above. I rebooted after fixing the SD card again and finally did "rpi-update", so now I am on the newest kernel (3.2.27+ #257 PREEMPT Mon Nov 5 00:01:55 GMT 2012 armv6l GNU/Linux) and am back in business. However, apt-get is still broken, I get the "dpkg --configure -a" messages all over again.

How can I fix this? I'm afraid that I might mess up the /boot partition again by running that command and get stuck in an endless loop. But I guess I have to complete the update because there are several packages like libraspberrypi-dev etc. that are still in their old versions before the update.

BTW, no overclocking or any other modifications.

Regards, Richard

Posts: 37
Joined: Sun Nov 04, 2012 5:08 pm
Location: USA
Contact: Website Yahoo Messenger

Re: apt-get upgrade broke on kernel-update

Wed Nov 07, 2012 3:16 pm

I went thru the same thing guy. last week mine tole me i had a conflict with one of the kernels. I just reloaded the sd card and started all over again. I use the latest weezey which came out on the 10/28. sorry i cannot be more therough on all this.

Posts: 58
Joined: Tue Jul 31, 2012 7:25 pm

rpikernelhack broke my dkpg database

Thu Nov 08, 2012 9:11 pm

Further research into the problem reveals that the installation of "raspberrypi-bootloader_1.20121025-1_armhf.deb" caused the problem. I found /var/log/apt/term.log, which shows that several diversions of files from /boot to /usr/share/rpikernelhack/ where added by "rpikernelhack", but later it failed to remove those diversions. The last entry in term.log says:

Code: Select all

»Umleitung von /boot/bootcode.bin zu /usr/share/rpikernelhack/bootcode.bin durch rpikernelhack« wird entfernt
where it hung indefinitely. I was able to restore the /boot partition files and update to the newest kernel with rpi-update, but all apt-get operations now fail and want me to run "dpkg --configure -a", which again results in lost files in my /boot partition and a non-booting Pi.

A similar problem was described in, where asb (Alex Bradbury) promised to get back to the poster with advice on how to fix the dpkg database, but never followed up on it because the poster blamed his defective SD card.

Please, I need help with fixing my dpkg database so I can use apt-get again.

Posts: 522
Joined: Wed Sep 12, 2012 7:23 pm
Location: Thionville
Contact: Website

Re: apt-get upgrade broke on kernel-update

Sat Feb 01, 2014 6:01 pm

One year later, same issue here

Code: Select all

Setting up raspberrypi-bootloader (1.20140107-1) ...
Memory split is now set in /boot/config.txt.
You may want to use raspi-config to set it
No diversion 'diversion of /boot/bootcode.bin by rpikernelhack', none removed.
No way to finish the update process without a kill command and then i can't install a new package
Raspberry Pi Home Server :
Software and electronic tutorials : Samba, Airplay, CUPS, Time machine, Nginx, Owncloud, rTorrent, Wordpress, etc.
Full Wi-Fi hotspot installation on a RPi 3 including a captive portal and freeradius management:

Posts: 58
Joined: Tue Jul 31, 2012 7:25 pm

Re: apt-get upgrade broke on kernel-update

Sun Feb 02, 2014 3:05 pm

I don't remember the steps I took to recover from this situation, but I managed to fix the dpkg/apt issue, at least for some time. At some point I found out that my SD-card was corrupted and I reinstalled cleanly onto a new card.

Return to “Troubleshooting”