Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Normally in Ubuntu if a new release is available the GUI will tell you. However, if you're running Ubuntu on the server, there is no GUI.

You can run lsb_release -a, which will at least tell you what your current release is, but that doesn't tell you whether there is a new release you can upgrade to. I'm trying to write a dead-simple "determine whether it's upgrade time" script, and it would be really handy to be able to do so via a command ... does anyone know one?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Check the command do-release-upgrade. If there is no new version available, it simply returns accordingly:

$ do-release-upgrade 
Checking for a new ubuntu release
No new release found

If there is a new release available, however, it goes on downloading the differences, asking for sudo password (if run by non-privileged user for upgrades).

For LTS versions of Ubuntu, I believe it only shows that there is an upgrade available if there is a new LTS version available. Do some more research of the tool to see its exact quirks.

share|improve this answer
    
I knew about do-release-upgrade, but didn't think it could be used "diagnostically" until I read your "run without sudo" idea; thanks! –  machineghost Apr 18 '12 at 19:02
    
Adding -s will also just show what it would have done, without actually doing anything. You can do this for instance to time an upgrade. –  oligofren Jun 8 '13 at 9:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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