Skip to content

Instantly share code, notes, and snippets.

@egordm
Created June 1, 2021 22:28
Show Gist options
  • Save egordm/3773a7dd92387a02d48f3ba0cfbbbb46 to your computer and use it in GitHub Desktop.
Save egordm/3773a7dd92387a02d48f3ba0cfbbbb46 to your computer and use it in GitHub Desktop.
Pacman wrapper to remember installed packages for later removal
# 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