Last active
March 2, 2022 06:49
-
-
Save gmolveau/4f1ababb87f9698030fa578f8ae3672e to your computer and use it in GitHub Desktop.
debian/ubuntu apt-get list installed top-level packages/apps only without dependencies
This file contains 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 characters
# source : https://unix.stackexchange.com/a/369653 | |
# not a perfect solution but it helps | |
python3 -c "from apt import cache;manual = set(pkg for pkg in cache.Cache() if pkg.is_installed and not pkg.is_auto_installed);depends = set(dep_pkg.name for pkg in manual for dep in pkg.installed.get_dependencies('PreDepends', 'Depends', 'Recommends') for dep_pkg in dep);print('\n'.join(pkg.name for pkg in manual if pkg.name not in depends))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment