2

I have a cron job that checks for new releases. I want to make sure it emails me when a new release is out of beta and ready to install. I want to upgrade to both long term support (LTS) releases and non-LTS releases. Is there a command that will tell me that such a release is available?

I've tried using do-release-upgrade -c -q and it tells me about the new release unless I'm currently on LTS and the next release is not LTS, (as documented here).

I've tried using do-release-upgrade -d -c -q. It tells me about non-LTS releases, but it also tells me about beta releases. For example, if I use it right now it tells me that 15.04 is available, but it hasn't actually been fully released yet, (as documented here).

What is the command to tell me about all releases that have been fully released, whether or not they are LTS?

2

I did some digging around in the code for do-release-upgrade. It appears that it downloads a file from http://changelogs.ubuntu.com/ to check for new releases. It downloads different files from there depending on the command line options provided. The file that would suit my needs is http://changelogs.ubuntu.com/meta-release

I don't see any options that will make do-release-upgrade download exactly that file, however it's easy enough to do with some command line tools:

currentrelease=`lsb_release -r | grep -oE '[0-9]{2}\.[0-9]{2}'`
availablerelease=`curl -s http://changelogs.ubuntu.com/meta-release | grep Version | tail -n 1 | grep -oE '[0-9]{2}\.[0-9]{2}'`
if [ "$currentrelease" != "$availablerelease" ]
then
    echo "New release '$availablerelease' available. To upgrade use:"
    echo "  sudo do-release-upgrade -d -f DistUpgradeViewNonInteractive"
fi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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