update manager and apt

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
iamthebull
Level 1
Level 1
Posts: 32
Joined: Mon Oct 14, 2019 1:50 am

update manager and apt

Post by iamthebull »

I was under the impression that the update manager is just a GUI interface for apt package manager. Is that incorrect?

The reason I ask is apt is telling me all packages are up to date but update manager is telling me there is a kernel update. Or is update manager using apt but configured to look at different repos?
um.png
apt.png
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gm10

Re: update manager and apt

Post by gm10 »

New kernel versions will only show up in apt as upgrades if you have got the a kernel meta package installed, because kernel versions remain available independently of each other.

Speaking of which, if you click on the Packages tab you'll find that that update is the linux-generic kernel meta package. I included code in Update Manager to check if a kernel meta package matching the active kernel is installed and if there isn't one then it tries to find one and will add it to the list of updates so you install it. This improves the behaviour of Update Manager in previous versions where it would just always suggest to install the highest available version number of a kernel series, ignoring the meta-packages (which unfortunately Mint does not pre-install).

So no, Update Manager is not just a front-end.
iamthebull
Level 1
Level 1
Posts: 32
Joined: Mon Oct 14, 2019 1:50 am

Re: update manager and apt

Post by iamthebull »

So Update Manager is more than 'just' a front end but does it still use apt for managing packages behind the scenes? or dpkg?

You said that Update Manager checks for a kernel meta package 'matching' the active kernel installed. What criteria is used for this matching?

My current kernel version is 4.15.0-54.58

If I use Update Manager it will install the linux-generic meta package which will update the kernel to version 4.15.0-65.74.

If I search in apt I get:

Code: Select all

$ apt list | grep linux-generic
linux-generic/bionic-updates,bionic-security 4.15.0.66.68 amd64
linux-generic-hwe-16.04/bionic-updates,bionic-security 4.15.0.66.68 amd64
linux-generic-hwe-16.04-edge/bionic-updates,bionic-security 4.15.0.66.68 amd64
linux-generic-hwe-18.04/bionic-updates,bionic-security 5.0.0.32.89 amd64
linux-generic-hwe-18.04-edge/bionic-updates 5.0.0.23.79 amd64
So if I use apt to install the linux-generic package then I will get updated to version 4.15.0-66.68 which I'm assuming, based on the version numbers is a more up to date kernel version. Is there any reason why Update Manager doesn't use this newer version? Does Mint search only a list of 'approved' kernel versions or anything like that?
gm10

Re: update manager and apt

Post by gm10 »

iamthebull wrote: Thu Oct 24, 2019 3:19 pm You said that Update Manager checks for a kernel meta package 'matching' the active kernel installed. What criteria is used for this matching?
I basically have it search for all available meta packages matching your installed kernel flavour and select one based on your release and installed kernel series. So if you had a 5.0 kernel installed then it would offer you the hwe meta package matching that series, but with the 4.15 series you'll get the default meta package. At least that's the basics, the actual logic is a bit more involved than that and considers a number of other factors as well.
iamthebull wrote: Thu Oct 24, 2019 3:19 pm So if I use apt to install the linux-generic package then I will get updated to version 4.15.0-66.68 which I'm assuming, based on the version numbers is a more up to date kernel version. Is there any reason why Update Manager doesn't use this newer version? Does Mint search only a list of 'approved' kernel versions or anything like that?
No, it's the same version, unfortunately the meta package and the actual kernel are not based on the same source package so the version numbers can differ. Within Update Manager you do not see this for I rewrite the meta-version to look like the kernel version it belongs to in order to avoid the confusion you just find yourself in. As I said, more than a simple front-end. ;)

And yes, at the end of the day everything uses the dpkg backend, including apt.
iamthebull
Level 1
Level 1
Posts: 32
Joined: Mon Oct 14, 2019 1:50 am

Re: update manager and apt

Post by iamthebull »

I just want to make sure I'm understanding this correctly. Update Manager and apt will both install the same kernel version, at least in this particular case, even though the version numbers are not the same? Which kernel version is it then 4.15.0-66.68 as indicated by apt or 4.15.0-65.74 as indicated by Update Manager?

One thing that is confusing is that Update Manager presents this as an 'update' in the first pace. Even the text in the packages tab for the kernel update says "This update affects the following installed package:". Update Manager in this case isn't updating an already installed package, it's installing a package that isn't installed yet.
um2.png
User avatar
Pjotr
Level 24
Level 24
Posts: 20141
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: update manager and apt

Post by Pjotr »

gm10 wrote: Thu Oct 24, 2019 4:46 pm No, (....) And yes
Jein! :lol:
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
gm10

Re: update manager and apt

Post by gm10 »

Maybe this helps illustrate it:

Code: Select all

$ apt depends linux-generic
linux-generic
  Depends: linux-image-generic (= 4.15.0.66.68)
  Depends: linux-headers-generic (= 4.15.0.66.68)

$ apt depends linux-image-generic
linux-image-generic
  Depends: linux-image-4.15.0-66-generic
  Depends: linux-modules-extra-4.15.0-66-generic
  Depends: linux-firmware
  Depends: intel-microcode
  Depends: amd64-microcode
  Recommends: thermald

$ apt show linux-image-4.15.0-66-generic
Package: linux-image-4.15.0-66-generic
Version: 4.15.0-66.75
[...]
iamthebull wrote: Thu Oct 24, 2019 5:21 pm One thing that is confusing is that Update Manager presents this as an 'update' in the first pace. Even the text in the packages tab for the kernel update says "This update affects the following installed package:". Update Manager in this case isn't updating an already installed package, it's installing a package that isn't installed yet.
Yes, I'm "cheating" a little, but I think it's the overall least confusing way, for most users will never know what I explained to you here, they just accept that it's an "update" and roll with it. If I was to instead create some interface asking to install a kernel meta package I'm sure we'd get bombarded with threads from users not understanding what's going on, so I just masquerade the whole thing as an update.

I had even considered simply installing it silently in the background without user intervention at all but decided that would be too intrusive. I strongly suggest you do install the meta package but I'm not going to force you.
iamthebull
Level 1
Level 1
Posts: 32
Joined: Mon Oct 14, 2019 1:50 am

Re: update manager and apt

Post by iamthebull »

I think I figured out what was causing a lot of the confusion. I posted two screenshots of Update Manager, one in the original post and another in my most recent post. In the first image Update Manager was indicating a kernel meta update of version 4.15.0-65.74 and apt was indicating a kernel meta update of version 4.15.0-66.68.

I believe between the two posts I refreshed Update Manager and now in the second image Update Manager is now showing the same kernel version update as apt (ie. 4.15.0-66.68). Which makes more sense. I'm assuming then that update manager keeps a separate local cache for available updates and it was not up to date at the time of my original post? Hence the discrepancy between versions. Is that a reasonable explanation?
gm10

Re: update manager and apt

Post by gm10 »

iamthebull wrote: Fri Oct 25, 2019 4:37 pm I'm assuming then that update manager keeps a separate local cache for available updates and it was not up to date at the time of my original post? Hence the discrepancy between versions. Is that a reasonable explanation?
Not a separate cache, it's just not automatically updating its state in the older releases. I only added that for 19.2, where it'll automatically refresh itself when it detects a change to the system's package cache, intentionally delayed by up to 90 seconds after the external application releases its lock on the package management system.

The kernel meta-selection logic I described above was also based on the state in 19.2 by the way.
iamthebull
Level 1
Level 1
Posts: 32
Joined: Mon Oct 14, 2019 1:50 am

Re: update manager and apt

Post by iamthebull »

I'm using 19.2 but it must have gotten stuck in a state where it did not auto update for some reason.
Locked

Return to “Software & Applications”