You can loop mount first the iso file and then the squashfs file:
Create mountpoints
sudo mkdir /mnt/lp1
sudo mkdir /mnt/lp2
Mount
sudo mount -o loop focal-desktop-amd64.iso /mnt/lp1
sudo mount -o loop /mnt/lp1/casper/filesystem.squashfs /mnt/lp2
Check for the kernel version
$ sudo find /mnt/lp2 -name "linux-image-[0-9.-]*-generic"
/mnt/lp2/usr/share/doc/linux-image-5.4.0-9-generic
My focal iso file was not downloaded today, you may find a newer kernel version.
Please note that there are several files, that belong to the kernel.
Edit:
Thanks for the heads up @Jags, I will add, that if you want to check for the kernel version in the newest versions of Ubuntu Server, for example in Mantiq (to be released as 23.10), there are 4 squashfs files, and you should use the following command line,
sudo mount -o loop mantic-live-server-amd64.iso /mnt/lp1
sudo mount -o loop /mnt/lp1/casper/ubuntu-server-minimal.ubuntu-server.installer.generic.squashfs /mnt/lp2
2023-09-26 I found linux-image-6.5.0-5-generic
,
$ sudo find /mnt/lp2 -name "linux-image-[0-9.-]*-generic"
/mnt/lp2/usr/share/doc/linux-image-6.5.0-5-generic
5.3.0-26-generic
kernel.