2

lsb_release -c gives me the current release, how from the command line can I determine the next release?

i.e. if lsb_release -c gives me 'utopic', how can I determine the next release is 'vivid' from the command line?

  • Note that lsb_release is not Ubuntu specific..its available in all OS that conform with the LSB (Linux Standard Base) standard..its just an attribute globally available that you can see whole release info including codename using lsb_release – heemayl Jun 26 '15 at 20:42
  • 2
    Release names aren't known that long in advance. What makes you think it's even possible? – terdon Jun 26 '15 at 21:35
  • @terdon, it's not that I need to know it well in advance, it's so that I can write my own script to detect when there is a next release and run the update my way ( apt-get update && apt-get dist-upgrade ) instead of ubuntu's way which has broke my system more than once. – Dev Null Jul 28 '15 at 23:55
2

Update Manager parses meta-release* files from http://changelogs.ubuntu.com to determine if a new release is available for upgrade. We can use http://changelogs.ubuntu.com/meta-release-development for this purpose:

wget -qO - http://changelogs.ubuntu.com/meta-release-development |
  awk '/^Dist:/ {print $2}' |
  awk "p{print; exit} /$(lsb_release -sc)/{p=1}"

This should print nothing if you are on the latest release and the next release name hasn't be published yet.

1

There is no reliable way to do this, but I have written the below function which should (in theory) continue to work forever:

function nxt_release() {
    curl -s http://cdimage.ubuntu.com/daily-live/current/ | grep \<h1\> | sed -e 's/<[^>]*>//g' -e s/'[Dd]aily [Bb]uild'/''/g
}  

Add this to your .bashrc file and run

source .bashrc  

You can then call it with:

nxt_release  

And it should print the next Ubuntu release. Make sure you have the curl package installed.

Of course, this will break if the layout or presentation scheme of the page changes, but this is the best way I can think of so far.

Please note that the next release's codename is not known for up to several months after the last release, it may not have been decided yet. This function should still print the version however.

  • 1
    This only works if the release codename is decided upon and daily builds enabled (so immediately after Wily is released this may break until X is announced) – Thomas Ward Jun 27 '15 at 3:14
  • @ThomasW. It will still work if the codename hasn't been announced. I assume the daily builds are started very soon after release. As I said in the answer, there is no "good" way of doing this that I am aware of. Still looking for better ideas though. – Seth Jun 27 '15 at 3:15

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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