Created
June 1, 2021 22:28
-
-
Save egordm/3773a7dd92387a02d48f3ba0cfbbbb46 to your computer and use it in GitHub Desktop.
Pacman wrapper to remember installed packages for later removal
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
# Usage: | |
# Install needed tmp packages | |
# pactmp -S junk package | |
# Remove the packages when not needed anymore | |
# pactmp -R | |
function pactmp() { | |
MODE=$1; shift | |
if [[ "$MODE" == "-S" ]]; then | |
sudo pacman -S $@; echo $@ >> ~/.pactmp | |
else | |
sudo pacman -R $(tail -n 1 ~/.pactmp); sed -i '$ d' ~/.pactmp | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment