Does Ubuntu keep a list of version upgrades?

pl flag

I was wondering if the Ubuntu version I am on will have a list of earlier versions that it has upgraded from?

Say I am on Ubuntu 20.04. Is there a CLI or GUI command that will list if it was upgraded from 18.04 or from 16.04 to 18.04 to 20.04?

cn flag

A list or command? No.

But there will be clues that a detective can use to put the pieces together.

  1. /var/log/installer includes files that will tell you what version was originally installed and when.

    There are different installers and different versions out there, so browse the contents of that directory until you find a useful file!

    Here's an example. See if you can figure out which release was originally installed:

    $ less /var/log/installer/casper.log 
    Source list entries for this disc are:
    deb cdrom:[Ubuntu 22.04 LTS _Jammy Jellyfish_ - Release amd64 (20220419)]/ jammy main restricted

    That was easy!

  1. dpkg -l | grep linux-image will list all the previous (and current) kernels installed by dpkg. Kernels are specific to a single release of Ubuntu, and metapackages like HWE are clearly labelled.

    Here's an example. See if you can figure out which release this system was upgraded to:

    $ dpkg -l | grep linux-image
    rc  linux-image-5.15.0-25-generic              5.15.0-25.25                             amd64        Signed kernel image generic
    rc  linux-image-5.15.0-48-generic              5.15.0-48.54                             amd64        Signed kernel image generic
    rc  linux-image-5.15.0-52-generic              5.15.0-52.58                             amd64        Signed kernel image generic
    rc  linux-image-5.19.0-21-generic              5.19.0-21.21                             amd64        Signed kernel image generic
    rc  linux-image-5.19.0-23-generic              5.19.0-23.24                             amd64        Signed kernel image generic
    rc  linux-image-5.19.0-35-generic              5.19.0-35.36                             amd64        Signed kernel image generic
    ii  linux-image-5.19.0-38-generic              5.19.0-38.39                             amd64        Signed kernel image generic
    ii  linux-image-5.19.0-40-generic              5.19.0-40.41                             amd64        Signed kernel image generic
    ii  linux-image-generic 

    Look at the kernel versions: The jump from 5.15 to 5.19 is important. It means EITHER that the system was release-upgraded from 22.04 to 22.10 OR that it's a 22.04 system using an HWE kernel.

    Next, look at the metapackages: linux-image-generic only. No HWE metapackage. That rules out one possibility.

    So we can deduce that this example system installed 22.04, and later release-upgraded to 22.10.

    That was also pretty easy after you know what to look for.

crip659 avatar
pl flag
I am probably doing something wrong or fish uses a different command, but #1 does not work, no such file or directory. #2 works perfectly. Seems like I started with 19.04 on this laptop.
nobody avatar
gh flag
`cat /var/log/installer/media-info` i think it depends on which release was intial installed.
user535733 avatar
cn flag
Edited the answer to address I-can't-find-the-installer-file.
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.