brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: do-release-upgrade -c checks for a new Ubuntu release without starting one

Ubuntu
~/tips/tip-ubuntu-do-release-upgrade-check

do-release-upgrade -c

Checks whether a newer Ubuntu release is available and reports it without starting an upgrade.

The scary part of do-release-upgrade is that it looks like it wants to start straight away. You can ask it a smaller question.

do-release-upgrade -c
echo $?

The man page says -c checks only whether a new distribution release is available and reports the result via the exit code. Nothing gets downloaded or changed, which makes it fine for a quick look or a monitoring script.

Whether it finds anything depends on the Prompt setting in /etc/update-manager/release-upgrades. The usual values are lts (only LTS to LTS), normal (any newer release) and never. Per the Ubuntu docs, an LTS only upgrades to the next LTS after its first point release. Before that you can force it with -d, which the docs advise against for production.

My habit: check, read the release notes, make a backup, then upgrade.

Put it in a cron job or a check script and you get a nudge when a new release opens up, instead of finding out months later.

Caveat: a quiet result may only mean the next LTS has not opened up for upgrades yet.

Further reading: do-release-upgrade(8) man page (Ubuntu 24.04), Ubuntu Server docs: Upgrade your release, On this site: pro status shows what Ubuntu Pro covers on your machine, On this site: ubuntu-drivers devices tells you which graphics driver to install

More Ubuntu tips sudo apt install ppa-purge grep ^Prompt /etc/update-manager/release-upgrades sudo tee /etc/update-motd.d/60-disk >/dev/null <<'EOF' ubuntu-bug openssh-server sudo update-alternatives --config editor All Ubuntu tips (8) All topics

Link