Apt-get dist-upgrade broken on alpha 4 on rpi2

As of now apt-get dist-upgrade is broken on alpha 4 (rpi2). Just wait for todays release and reinstall?

osmc@osmc-uppe:~$ sudo apt-get dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following NEW packages will be installed:
armv6l-connman-osmc armv6l-network-osmc armv7-connman-osmc
armv7-network-osmc
The following packages will be upgraded:
base-files-osmc diskmount-osmc wireless-firmware-osmc
3 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 4519 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://apt.osmc.tv/ jessie/main armv6l-connman-osmc armhf 1.1.4 [281 kB]
Get:2 http://apt.osmc.tv/ jessie/main wireless-firmware-osmc all 1.0.3 [3940 kB]
Get:3 http://apt.osmc.tv/ jessie/main armv6l-network-osmc armhf 1.3.2 [2636 B]
Get:4 http://apt.osmc.tv/ jessie/main armv7-connman-osmc armhf 1.1.4 [287 kB]
Get:5 http://apt.osmc.tv/ jessie/main armv7-network-osmc armhf 1.3.2 [2644 B]
Get:6 http://apt.osmc.tv/ jessie/main base-files-osmc all 1.3.9 [3888 B]
Get:7 http://apt.osmc.tv/ jessie/main diskmount-osmc all 1.1.9 [1888 B]
Fetched 4519 kB in 1s (2317 kB/s)
(Reading database … 18824 files and directories currently installed.)
Preparing to unpack …/armv6l-connman-osmc_1.1.4_armhf.deb …
Unpacking armv6l-connman-osmc (1.1.4) …
dpkg: error processing archive /var/cache/apt/archives/armv6l-connman-osmc_1.1.4_armhf.deb (–unpack):
trying to overwrite ‘/lib/systemd/system/connman.service’, which is also in package connman 1.21-1.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/armv6l-connman-osmc_1.1.4_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
osmc@osmc-uppe:~$

do
sudo apt-get update && sudo apt-get upgrade

I see the problem here. An architecture dependent meta is being marked as Essential which is dangerous!

I fixed this in

Sam

1 Like

That takes care of the packages that are updated, but dist-upgrade still fails on the new packages.

Yeah, I see it now - it tries to install the same packages for both armv61 and armv7 - that can’t be good.

I updated from an alpha 4 base install as follows. It is worth noting that, when removing connman/network-osmc packages prior to updating, you shouldn’t be working over ssh.

Change /etc/apt/sources.list to work with Debian rather than Raspbian:

deb http://ftp.debian.org/debian jessie main contrib non-free
deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://apt.osmc.tv jessie main

Then do:

sudo apt-get update && sudo apt-get install debian-archive-keyring

From looking at my dpkg selections, you’ll need to remove the following packages. Some would be removed as deps, but I can’t remember which.

sudo apt-get remove rbp-eventlircd-osmc rbp-libafpclient-osmc rbp-libcec-osmc rbp-libnfs-osmc rbp-librtmp-osmc rbp-libshairplay-osmc rbp-lirc-osmc rbp-mediacenter-osmc rbp-remote-osmc rbp-splash-osmc connman network-osmc liblircclient0 lirc ftr-osmc

I put a few packages on hold to stop them installing:

sudo echo 'amv61-network-osmc hold' | sudo dpkg --set-selections
sudo echo 'amv61-connman-osmc hold' | sudo dpkg --set-selections
sudo echo 'ftr-osmc hold' | sudo dpkg --set-selections

Now you can do an apt-get upgrade to pull in all the standard Debian armhf packages. Next, install the rbp2-* packages.

sudo apt-get install rbp2-device-osmc

As I remember, this will pull in everything required, i.e. the new kernel, kodi etc.

The only remaining thing, as far as I’m aware, is to make the device boot the updated kernel, but I’m not so familiar with the Pi… Will simply copying /boot/vmlinuz-3.18.7-3-osmc to /boot/kernel7.img do the trick?

Hi,
nice guide. I used it to upgrade it as well from alpha4 and encountered also networkloss during the upgrade.
/boot/kernel.img is needed for the first generation of pi’s, /boot/kernel7.img is needed to boot pi2.
copying /boot/kernel.img to /boot/kernel7.img resulted in my setup into booting to the new kernel.
As long as you have installed the rpb2 kernel this seems to work out ok. I am also not too experienced with the pi, but it looks like the script /etc/kernel/postinst.d/process-vmlinuz-rbp arranges generation of the kernel boot images and it generates a /boot/kernel.img only currently so things could be fixed there for good I would say.

I made some modifications in the above mentioned script and it seems to work ok:

   root@osmc:/etc/kernel/postinst.d# cat /etc/kernel/postinst.d/process-vmlinuz-rbp 
#!/bin/sh

processimage()
{
    # use mkknlimg to rename the kernel too
    PI2ARCH="armv7l"
    PI1ARCH="armv6l"
    MYARCH=$(uname -m)
    MYBOOTIMG=""
    if [ $MYARCH = $PI2ARCH ]; then MYBOOTIMG="/boot/kernel7.img";fi
    if [ $MYARCH = $PI1ARCH ]; then MYBOOTIMG="/boot/kernel.img";fi
    LANG=C /usr/bin/mkknlimg --dtok ${2} $MYBOOTIMG >/dev/null 2>&1
    EXIT=$?; if [ $EXIT -ne 0 ]; then cp -f ${2} $MYBOOTIMG; exit $EXIT; fi

    rm -rf /boot/*.dtb /boot/overlays/
    cp -af /boot/dtb-${1}/* /boot/
    EXIT=$?; if [ $EXIT -ne 0 ]; then exit $EXIT; fi

    rm -rf /lib/modules/${1}_kernel_*
}

if [ -f /boot/bootcode.bin ]; then processimage $1 $2; fi
root@osmc:/etc/kernel/postinst.d# 

(i tested it by reinstalling the kernel and it gave me a /boot/kernel7.img automatically)
the script is part of the rbp-userland-osmc package. not sure if this is the supposed way to fix it. At least the userland package seems to need an update; might be worthwhile if the osmc developers take a look at the problem ?

Yep, that’ll do the trick - thanks :smile: