Issue
I'm trying to write a python script that sends notifications whenever there is a new OS release. I have some working code using subprocess
in Python to invoke sudo apt update
. But does this provide information about new OS releases, or "only" about new upgradable packages? That is, does the term "upgradable packages" imply OS releases as well?
Otherwise, how can I find out programmatically from Python whether a new Debian OS release is available?
Solution
You can check the release name in your mirror, e.g.: http://ftp.fi.debian.org/debian/dists/stable/Release . Check e.g. for the line codename
(if you care just release, or the Version
if you care about point releases), and if it has changed from last time, you have a new release. Note: you may see a new release before official announcement or later (by few days), but that is due for practical reasons during release.
Check carefully a mirror near you, and do not ask too many time per day about release. And better: ask if the file is changed and download it only in such case.
Answered By - Giacomo Catenazzi Answer Checked By - Cary Denson (WPSolving Admin)