Created
December 11, 2020 17:34
-
-
Save maximtrp/f81c5f31880d670e79b0b8b0817527a7 to your computer and use it in GitHub Desktop.
Filter updated packages installed using pip (and not pacman)
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
#!/usr/bin/bash | |
# updated packages | |
echo "[1] Getting updated packages list" | |
pip list -o | tail -n +3 | cut -d" " -f1 | tr - _ | sort > updated.txt | |
# pip-managed packages | |
echo "[2] Getting packages managed by pip" | |
find /usr/lib/python3.9/site-packages/ -name INSTALLER | grep --color -oE "site-packages/([^-\/]*?)" | sed "s/site-packages\///g" | sort > installed.txt | |
# intersect to create a list of updatable packages | |
echo "[3] Creating the list of updatable packages:" | |
grep -Fxf updated.txt installed.txt > update-list.txt | |
cat update-list.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment