Kernel package is not in the Package lists

I'm trying to install Samba or NFS, but I evidently don't have enough space for Samba (it says there's enough space, barely, but the install keeps failing). So now I want to install NFS, but there's a dependency for the kernel package which is not available.

I would be okay with sshfs instead, even though I know it's slower, but that also requires the kernel package. And so does ksmbd.

I found this bug report with basically the same problem, and it gives a workaround that I should download and install the kernel package manually.

So I go to the package table, but it's not there. So my question is: how do I install the kernel package?

You don't, the kernel itself is not a downloadable/ installable package, it's embedded into the base image (and for most devices in a rather particular way), it can't be upgraded without flashing a new OpenWrt version.

Either you find (download and install) the kmods exactly matching your installed kernel(-abi), which only works only for a limited amount of time for snapshot builds and not at all for custom oned, or you have to sysupgrade to a current image version first and install your desired kmod packages immediately after.

2 Likes

Hm... it looks like to do a sysupgrade I should use the luci-app-attendedsysupgrade package, but that is also missing a dependency:

Required dependency package libucode20220812 is not available in any repository.

It seemed to install anyway, so I ran it but it's just giving me "Searching for an available sysupgrade" forever. I should be up to date anyway, only installed this a few days ago.

One of the replies in the bug report that I linked said that there was a dummy package for the kernel. Not a real package, but something that would suffice for my situation. That's really what I was looking for.

What's currently on your device, and what is the hardware we're talking about:

ubus call system board
"kernel": "5.15.134",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7621 ver:1 eco:3",
        "model": "Netgear R6220",
        "board_name": "netgear,r6220",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.0",
                "revision": "r23497-6637af95aa",
                "target": "ramips/mt7621",
                "description": "OpenWrt 23.05.0 r23497-6637af95aa"
        }

Your problem seems a bit strange insofar as there is plenty of storage on that device and you're running a stable release build, so the repo should be valid.

Have you run opkg upgrade at any point? (upgrade, not update)
And have you ever change the repos that opkg uses?

What is the output from the following:

df -h
opkg update
opkg install luci-app-attendedsysupgrade
1 Like
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                    58.9M    116.0K     58.8M   0% /tmp
/dev/ubi0_1              17.1M      7.6M      8.6M  47% /overlay
overlayfs:/overlay       17.1M      7.6M      8.6M  47% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2                 8.0T    431.7M      8.0T   0% /mnt/sda2
root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/23.05.0/targets/ramips/mt7621/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/23.05.0/targets/ramips/mt7621/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/23.05.0/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.
root@OpenWrt:~# opkg install luci-app-attendedsysupgrade
Package luci-app-attendedsysupgrade (git-23.339.51123-138595a) installed in root is up to date.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency libucode20220812 for rpcd-mod-ucode
 * pkg_hash_fetch_best_installation_candidate: Packages for rpcd-mod-ucode found, but incompatible with the architectures configured

My only guess about what could have gone wrong is using this script to free up space after a failed install. Maybe, perhaps, it removed a needed dependency.

Other than that I don't think I've done anything weird.

EDIT: I was wrong about this... see @hnyman 's response below. The backup and flashing the upgrade still stands as a good means of getting back into a working state, from which point ASU can be used in the future.

This shows your target architecture:

and there are some lists being pulled from the correct target:

Somehow you have the wrong architectures here...

and that results in this message:

I'm not sure how that happened. You can try to repair it, but I think you may be best served by simply making a backup and then running an upgrade without keeping settings. Then, when your device is back up and running again, you can carefully cherry-pick the config files to restore (typically the network, dhcp, firewall, and wireless files, maybe a few others).

Okay. Well that's weird, but at least I've got a plan now. I'll give it a try, thanks.

Where?

ramips/mt7621 is the main kernel/image target, kmods etc.
mipsel_24kc is the vanilla package architecture for ramips/mt7621.

(All routers have that kind of difference in /etc/opkg/distfeeds.conf links)

That multi-purpose error is sometimes misleading.

I think that @Peon is just suffering from the ABI differences between old/deprecated 23.05.0 and the userland packages compiled for 23.05.2 and further.

1 Like

Thanks... I was actually beginning to re-think and re-evaluate my statements above, but I hadn't gotten through the full exercise of that before you noticed my folly. I'll edit to indicate that this was incorrect.

@Peon -- sorry, I clearly had that wrong. @hnyman is on the right track.

1 Like