Last active
March 11, 2022 04:48
-
-
Save srkiNZ84/57f22d256be87f59b7575a5584239ef8 to your computer and use it in GitHub Desktop.
Revisions
-
srkiNZ84 revised this gist
Mar 11, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,9 @@ if dep_cache.is_upgradable(pkg) and pkg.current_state == apt_pkg.CURSTATE_INSTALLED: #print(" ", pkg.name) need_upgrade.append(pkg.name) print(pkg.name, " needs upgrade. Current version is: ", pkg.current_ver.ver_str, "\n latest is: ", \ dep_cache.get_candidate_ver(pkg).ver_str) print(json.dumps(need_upgrade)) -
srkiNZ84 revised this gist
Mar 11, 2022 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,16 @@ import apt import apt_pkg import json need_upgrade = [] cache = apt.apt_pkg.Cache() dep_cache = apt.apt_pkg.DepCache(cache) for pkg in cache.packages: if dep_cache.is_upgradable(pkg) and pkg.current_state == apt_pkg.CURSTATE_INSTALLED: #print(" ", pkg.name) need_upgrade.append(pkg.name) print(json.dumps(need_upgrade)) -
srkiNZ84 created this gist
Mar 11, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/usr/bin/python3 # NOTE: Requires the python3-apt package import apt import apt_pkg cache = apt.apt_pkg.Cache() dep_cache = apt.apt_pkg.DepCache(cache) for pkg in cache.packages: if dep_cache.is_upgradable(pkg) and pkg.current_state == apt_pkg.CURSTATE_INSTALLED: print(" ", pkg.name)