-
-
Save kleini/fed2d4ec203c9cf94169e2a30e60e53e to your computer and use it in GitHub Desktop.
Find Debian/Ubuntu packages without installed dependencies
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 characters
First of all we list packages during upgrade, that are not marked as automatically handled: | |
aptitude search -F '%p' --disable-columns '~U' | while read PACKAGE; do sudo apt-mark showmanual $PACKAGE; done | |
Second I want to find even those packages, that are already automatically handled but are still installed although nothing | |
installed depends on it | |
aptitude search -F '%p' --disable-columns '~U' | while read PACKAGE; do echo -n "$PACKAGE "; apt-cache rdepends $PACKAGE | tail +3 | while read RDEPEND; do dpkg --get-selections | egrep "^${RDEPEND}.*\s" | wc -l; done | paste -sd+ | bc; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment