1

I can find the version OS that's installed on my Pi 4. But how can I find out the official current version? Preferably in a way that can be scripted.

What I would love to do would be to write a script that would determine the version OS installed on my Pi (easy), then get the current official version (unknown), compare the two, and send myself an email if they differ. I would then schedule this in cron to run once a month.

Then, I wouldn't have to remember to check it manually. (When done manually I alternate between checking every couple of days, and checking once a year or so.)

Then, when I get an email that I'm out of date, I set aside some time to do the upgrade, and more importantly validating that the upgrade didn't break anything.

EDIT: I'm talking about major release levels, ie Stretch -> Buster-> Bullseye -> Trixie

5
  • There are updates to the OS every few days - so there will always be OS updates available every month. Seems pointless sending an email?
    – CoderMike
    Jul 29 at 18:39
  • in a script you could run an apt update followed by an apt list --upgradable - more than one line in the latter means something can be upgraded (actually the output of apt update would tell you that there are upgrades available so the apt list is not really required, but is easier to parse to check if upgrades are available) Jul 29 at 23:28
  • I should have specified MAJOR release. Basically, I want to know when I need to do a major upgrade from Bullseye to Bookworm.
    – bdixon
    Jul 30 at 19:30
  • "I should have specified MAJOR release." These ONLY happen very 2 years (after the corresponding Debian release) so there is no point in checking monthly! When they happen they are announced on the News Blog (and they NEVER support cross OS upgrade.
    – Milliways
    Jul 30 at 23:46
  • I know they don't happen often. But I have an Ubuntu machine that ended up 2 or 3 major releases behind because I neglected it, and in order to fix some problems I'm going to have to do a multi-step upgrade. (Have to go through an intermediate release.) I don't want to go through that with my Pi's, so I'll automated the checking. That way, I don't have to remember to check the blog.
    – bdixon
    Aug 1 at 2:00

2 Answers 2

1

You could check the codename in http://raspbian.raspberrypi.org/raspbian/dists/stable/Release

stable in that URL always points to the latest stable release.

2
  • Perfect. Now I can run "curl raspbian.raspberrypi.org/raspbian/dists/stable/Release 2>&1 | grep Codename ; grep "VERSION_CODENAME" /etc/os-release" - then it's a simple matter to put that into a script, capture & compare the two values, and send an email of they are different. Thanks
    – bdixon
    Jul 30 at 19:32
  • I noticed yesterday that the above referenced site shows "Suite: stable / Codename: bookworm", but it also says "Description: Debian armhf testing distribution for Raspberry Pi". So, on the one hand it lists bookworm as (presumably) the latest stable release, but on the other hand it explicitly says it's a testing release. So, comparing this with my current install does give me a heads up that I'm going to be "out of date" sometime soon. But is there another url that would tell me what the current stable "you should be using this" major version is?
    – bdixon
    Sep 26 at 13:13
1

"the current official version of Raspberry Pi OS" is meaningless; the OS is regularly updated.

Maybe every few months or so the latest is packaged into an image so those doing a fresh install get a reasonably up-to date OS but this is of no use to those with an existing OS.
Even less frequently there is a Blog post announcing the "Latest".
If you REALLY want to know when these releases are produced see https://downloads.raspberrypi.org/raspios_armhf/images/


I update my OS daily - it only takes a few seconds.

If there are updates I check to see if anything I use is updated and upgrade if warranted.

If you use Raspberry Pi OS Bullseye with Desktop a notification pops up if there are updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.