Automatically detect newest version of 12.x, 14.x, or 16.x series
Closed this issue · 5 comments
In #15, wget got a 404 instead of the iso, because Ubuntu had bumped 14.04.3 to 14.04.4. This will happen every few months as they release maintenance updates, requiring this script to make a code change to download the latest version.
It would be nice to figure out a method to automatically determine the latest version of each series. The naive way would be to try a version, and while it gets a 404, increment the revision number and try again.
This isn't ideal, but I don't know if Ubuntu has a way to programmatically get a version number. I've asked on stackexchange so that might help.
It sounds like a nice addition to the script and I will most certainly merge any decent PR which adds this functionality. I don't have time atm to do any work on this myself, so all PR's are more than welcome!
I have not yet been able to find any way to identify the newest release of Ubuntu without screen scraping pages. Some distros in the past had a current release symlink in their download directories, which always pointed at the file which was newest. Some had a text file containing version numbers.
Closest idea I have is to start with a number 14.04.3 and increment the revision after every 404 response. This is obviously not ideal, as it could iterate through a large number of revisions before finding the correct one. Or it could fail entirely if someone numbered it 14.04.05 instead of 14.04.5 for some reason.
My thought is that we won't get to automate this without someone at Ubuntu providing a text file, or current release symlink or something like that.
lsb_release -r -s
outputs the runnig Ubuntu version. I hope that helps!
@incrazyboyy : lsb_release gets the version of the currently running Ubuntu. It is not getting the newest release version. I'm not interested in what version I have installed, but the newer version which I haven't downloaded yet.
I did, sent a PR.