Ubuntu 20.04.6 LTS apt problems - how to upgrade f/w?

Bo Berglund bo.berglund at gmail.com
Thu Nov 28 17:16:28 UTC 2024


On Wed, 27 Nov 2024 17:21:09 +0100, Nils Kassube via ubuntu-users
<ubuntu-users at lists.ubuntu.com> wrote:

>On 27.11.24 Bo Berglund wrote:
>> On Wed, 27 Nov 2024 12:47:08 +0100, Nils Kassube via ubuntu-users
>> <ubuntu-users at lists.ubuntu.com> wrote:
>>
>> >On 27.11.24 Bo Berglund wrote:
>> >> menuentry 'Ubuntu 20.04.3 LTS (20.04) (on /dev/nvme0n1p5)'
>> >
>> >So you also have an older Ubuntu version on the system.
>>
>> It seems like there is, I remember that when I started this Linux device a
>> number of years back it was migrated from an older machine that also had a
>> desktop version on the side, which I only used a few times.
>
>> >Could it be that you actually boot from the grub menu of 20.04.3?
>> >I would suggest to mount /dev/nvme0n1p5 and check if there is a grub
>> >entry for your current kernel there.
>>
>> I have mounted the partition now and it sure looks like a linux system.
>> If I go into it I find:
>>
>> $ ll boot/grub/grub.cfg
>> -r--r--r-- 1 root root 15508 2021-10-31 11:24 boot/grub/grub.cfg
>>
>> $ ll etc/default/grub
>> -rw-r--r-- 1 root root 1210 2021-10-29 11:23 etc/default/grub
>>
>> The dates show when this was last used, I guess, so 3 years ago...
>
>Right, it is quite long ago since you updated that partition. I mean "20.04.3" indicates the same.
>
>> Looking on the grub of that not running machine:
>>
>> $ grep "menuentry " boot/grub/grub.cfg
>
>> menuentry 'Ubuntu, with Linux 5.4.0-89-generic (on /dev/nvme0n1p6)' <== HERE
>
>> So the kernel I cannot get away from is *not* part of the "other" linux since it
>> is listad as coming from /dev/nvme0n1p6 (my active machine) while the partition
>> for the other Ubuntu is /dev/nvme0n1p5....
>
>I think you can still boot the current kernel from the boot menu of the old system because you have a menuentry there. It doesn't matter that the actually used partition is nvme0n1p6 and not nvme0n1p5. Please check the line like
>
>   set default="0"
>
>near the top of the grub.cfg file on nvme0n1p5. If the number is "8" (if I counted right) you are very likely booting with grub from the other partition.
>
Well if a desktop user reboots and selects the boot menu item:

Ubuntu, with Linux 5.4.0-89-generic

then he will surely boot into the *server* using that kernel, which I want to
upgrade from....

To answer the question:

The numbers have been 3 and 0...

Long reply below:

In the boot/grub/grub.cfg file on the non-used Ubuntu Desktop I see this about
23 lines down:

if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="3"
fi

This might be why there was a 3 originally...

***Expedition search****
------------------------
Check the current active kernel on Server:

$ uname -r
5.4.0-89-generic

Enumerate the available kernels on the server machine:

$ dpkg --list 'linux-image*' | grep ^ii
ii  linux-image-5.15.0-126-generic  5.15.0-126.136~20.04.1 amd64  Signed kernel
image generic
ii  linux-image-5.4.0-200-generic   5.4.0-200.220          amd64  Signed kernel
image generic
ii  linux-image-5.4.0-89-generic    5.4.0-89.100           amd64  Signed kernel
image generic
ii  linux-image-generic             5.4.0.200.196          amd64  Generic Linux
kernel image
ii  linux-image-generic-hwe-20.04   5.15.0.126.136~20.04.1 amd64  Generic Linux
kernel image

Here we see the problematic 5.4.0-89, which I want to upgrade from.

Looking at the Desktop disk:
----------------------------
I mounted /dev/nvme0n1p5, which is the disk for the Desktop Ubuntu I have
not used after October 2021 but still here.

$ cd /mnt/ubuntudsk  #This is the mount for the Desktop partition
$ grep "menuentry " boot/grub/grub.cfg

The result after editing out the end of long lines to make it fit here:

menuentry 'Ubuntu'
menuentry 'Ubuntu, with Linux 5.11.0-38-generic'
menuentry 'Ubuntu, with Linux 5.11.0-38-generic (recovery mode)'
menuentry 'Ubuntu, with Linux 5.11.0-27-generic'
menuentry 'Ubuntu, with Linux 5.11.0-27-generic (recovery mode)'
----- The above are on the Ubuntu Desktop machine --------

menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' 
----- The line above is for the Windows boot ---------------

----- And below are read from the Ubuntu Server back in 2021 ----
menuentry 'Ubuntu 20.04.3 LTS (20.04) (on /dev/nvme0n1p6)'
menuentry 'Ubuntu (on /dev/nvme0n1p6)'
menuentry 'Ubuntu, with Linux 5.4.0-89-generic (on /dev/nvme0n1p6)' 
menuentry 'Ubuntu, with Linux 5.4.0-89-generic (recovery mode) (on
/dev/nvme0n1p6)'
menuentry 'Ubuntu, with Linux 4.15.0-161-generic (on /dev/nvme0n1p6)'
menuentry 'Ubuntu, with Linux 4.15.0-161-generic (recovery mode) (on
/dev/nvme0n1p6)'
menuentry 'Ubuntu, with Linux 4.15.0-159-generic (on /dev/nvme0n1p6)'
menuentry 'Ubuntu, with Linux 4.15.0-159-generic (recovery mode) (on
/dev/nvme0n1p6)'

----- Below are entries for other bootable stuff on the drive ------
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
menuentry "GParted live" {
menuentry "Bootable ISO Image: gparted-live-1.3.1-1-amd64" {
-----------------------------------------------------------------------

As you can see the 5.4.0-89 entries on Server are referenced by the Desktop...
And by the timestamp of the file it was done back in 2021!

Also note that the other external entries from the Desktop back then are no
longer available there, they have long since been replaced by later versions.

So could it be that the fact that there is a grub boot menu on the Desktop
machine that references the Server active kernel 5.4.0-89 makes it remain also
on the Server machine, since if it was removed from the Server then the grub.cfg
on the Desktop would be broken? Or what could it be that keeps the kernel on the
Server?

Probably the apt update/upgrade/remove and update-grub actions on the Server
cannot include *removing* a kernel referenced from the Desktop....

Now when the update-grub command is executed it seems like it scans both the
current disk but also searches through all other partitions for an Ubuntu
installation with a /boot/grub/grub.cfg file and possibly also /etc/default/grub
and if found it merges in data from that too into its main boot menu
compilation?

That would happen when one issues sudo update-grub on the Server machine.

If at that time there is no longer any partitions containing references to those
kernels surely nothing would be fetched into the grub menu from the Desktop,
or???

Of course the final grub boot menu in the efi partition has to contain current
stuff from all bootable partitions in order to start any machine if the user so
chooses...

So the entries for the Desktop may well contain this since it has not been
running since 2021, but why entries for Server do is beyond me.

I really do not understand what to do in order to get my server update its
kernel use to the more recent ones available.

My best bet now is to simply reformat the Desktop partition completely thus
purging its Ubuntu Desktop from the system altogether.

After that I should be able to sudo update-grub to clean it all up and finally
boot into a newer kernel, right?

Do you think I have to hook up a display and keyboard to the PC so I can
interact with the boot menu in this case?


-- 
Bo Berglund
Developer in Sweden




More information about the ubuntu-users mailing list