Skip to content

Instantly share code, notes, and snippets.

@zerwes
Created September 1, 2022 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerwes/9df84303ae6b3a5faaf5fc4275e955d2 to your computer and use it in GitHub Desktop.
Save zerwes/9df84303ae6b3a5faaf5fc4275e955d2 to your computer and use it in GitHub Desktop.
find packages not distributed by the current distro - for example after doing what you should never do: a dist upgrade from ubuntu to debian :-)
#! /usr/bin/env python3
# apt install python3-apt
import apt
cache = apt.Cache()
for pkg in cache:
if cache[pkg.name].is_installed:
continue
if cache[pkg.name].candidate:
continue
print(pkg.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment