Nextcloud Box Raspberry Pi Stuck on Old Kernel – Upgrade Guide

kernelnextcloudraspberrypiupgrade

I have the nextcloud box. It uses an Ubuntu (core?) image with the nextcloud snap that I 've put on a Raspberry pi 2. My problem is that I don't see the pi upgrading to a newer kernel. To better explain the situation here are some results from the terminal:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial
$ uname -r
4.4.0-1017-raspi2
$ snap list
Name       Version      Rev   Developer  Notes
core       16-2         1267  canonical  -
nextcloud  11.0.2snap2  1190  nextcloud  -

If one goes to Ubuntu to mainline page on the "xenial linux-raspi2" section you can see that there are a lot of more recent kernels released.

However if I run:

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory 
'/etc/apt/apt.conf.d/' as it has an invalid filename extension
$ sudo apt dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory 
'/etc/apt/apt.conf.d/' as it has an invalid filename extension

The ignored file comes after updating the default image and getting a conflict I wasn't sure how to address. I decided to use the new file from the updated package (Ithink). I 've read the file and think it's ok. I could manually deleted but decided to leave there. I don't know what's different in the Ubuntu image nextcloud box ships that prevents the upgrade.

Is there any way to check what option is preventing Ubuntu from getting a newer kernel and fix it? Those are kernels officially released by Canonical so there should be a way to update to them.

Update:

While trying to fix the problem I found about the linux-raspi2 package. More specifically when I 'm ssh'd into the nextcloudbox (ie raspberry pi2) I am typing the following:

$ apt-cache policy linux-image*1017-raspi2
linux-image-4.4.0-1017-raspi2:
  Installed: 4.4.0-1017.23
  Candidate: 4.4.0-1017.23
  Version table:
 *** 4.4.0-1017.23 500
        500 http://ports.ubuntu.com xenial-updates/universe armhf Packages
        500 http://ports.ubuntu.com xenial-security/universe armhf Packages
        100 /var/lib/dpkg/status
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory 
'/etc/apt/apt.conf.d/' as it has an invalid filename extension
$ apt-cache policy linux-raspi2
linux-raspi2:
  Installed: (none)
  Candidate: 4.4.0.1046.45
  Version table:
     4.4.0.1046.45 500
        500 http://ports.ubuntu.com xenial-updates/universe armhf Packages
        500 http://ports.ubuntu.com xenial-security/universe armhf Packages
     4.4.0.1009.9 500
        500 http://ports.ubuntu.com xenial/universe armhf Packages
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory 
'/etc/apt/apt.conf.d/' as it has an invalid filename extension

When I tried to install the linux-raspi2 package the ensuing process did download an updated kernel. When I told the raspberry pi to reboot however I lost contact with it. Meaning I could neither ssh into it nor could it connect to my router anymore (I logged in at the router as adming and I couldn't find it). I ended up replacing the image on the sd card with the one that came when I bought it (backups ftw !!). After I set it up again I am still at the problem described initially. Kernel is stuck at an old version.

I am not sure what went wrong with the update. This is the info on linux-image-4.4.0-1017-raspi2from /var/lib/dpkg/status

Package: linux-image-4.4.0-1017-raspi2
Status: install ok installed
Priority: optional
Section: kernel
Installed-Size: 102353
Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
Architecture: armhf
Source: linux-raspi2
Version: 4.4.0-1017.23
Provides: fuse-module, ivtv-modules, kvm-api-4, linux-image, linux-
image-3.0, redhat-cluster-modules
Depends: initramfs-tools (>= 0.36ubuntu6) | linux-initramfs-tool, kmod
Pre-Depends: dpkg (>= 1.10.24)
Recommends: flash-kernel
Suggests: fdutils, linux-raspi2-tools, linux-headers-4.4.0-1017-raspi2
Conflicts: hotplug (<< 0.0.20040105-1)
Description: Linux kernel image for version 4.4.0 on ARM (hard float) SMP
 This package contains the Linux kernel image for version 4.4.0 on
 ARM (hard float) SMP.
 .
 Also includes the corresponding System.map file, the modules built by 
 the
 packager, and scripts that try to ensure that the system is not left in an
 unbootable state after an update.
 .
 Supports Generic processors.
 .
 Geared toward desktop and server systems.
 .
 You likely do not want to install this package directly. Instead, 
 install
 the linux-raspi2 meta-package, which will ensure that upgrades work
 correctly, and that supporting packages are also installed.

So what I did (sudo apt install linux-raspi2) shouldn't have bricked the rpi2 (right?). But it did. Any clues?

Best Answer

The solution has been to ditch the official image and use the image provided by the nextcloudpi project. It is based on Raspbian instead of Ubuntu so it doesn't solve the problem within the scope of Ubuntu but at least you can get security updates for the kernel your Raspberry pi is running.

Related Question