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?
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.
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.
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 usinglsb_release