Ducksec Feb 10, 2024 ubuntu, troubleshooting

Ubuntu: Wrong release number after upgrade

After upgrading an Ubuntu machine to 20.10, I ran into an interesting error - although the upgrade was successful, the system in question still seemed to think it was running the previous version of Ubuntu - Running lsb_release gives me the following, still showing the old version form which I just upgraded:

duck@server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.04
Release:        23.04
Codename:       lunar

I was not able to find a solid explanation as to exactly why this happened! My best guess is that one or more of the base files were modified (by me) and therefore were not updated during the upgrade. The solution was to reinstall the base-files package, which contains /etc/lsb_release

duck@server:~$ sudo apt reinstall base-files
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  wmdocker
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
  base-files
1 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Need to get 73.8 kB of archives.
After this operation, 26.6 kB of additional disk space will be used.
Get:1 http://im.archive.ubuntu.com/ubuntu mantic-updates/main amd64 base-files amd64 13ubuntu2.1 [73.8 kB]
Fetched 73.8 kB in 1s (92.4 kB/s)   
(Reading database ... 199351 files and directories currently installed.)
Preparing to unpack .../base-files_13ubuntu2.1_amd64.deb ...
Unpacking base-files (13ubuntu2.1) over (12.3ubuntu2.1) ...
Setting up base-files (13ubuntu2.1) ...
Installing new version of config file /etc/debian_version ...
Installing new version of config file /etc/issue.net ...
motd-news.service is a disabled or a static unit not running, not starting it.
Processing triggers for plymouth-theme-ubuntu-text (22.02.122-3ubuntu2) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for install-info (7.0.3-2) ...
Processing triggers for man-db (2.11.2-3) ...
Processing triggers for initramfs-tools (0.142ubuntu15.1) ...
update-initramfs: Generating /boot/initrd.img-6.5.0-14-generic


Now, uname -a and lsb_release -a both display correctly.

duck@server:~$ uname -a
Linux server 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
duck@server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantic

Hopefully, this helps someone!