diff options
author | Britney Fransen <brfransen@gmail.com> | 2018-09-04 14:22:50 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2018-09-04 14:22:50 (GMT) |
commit | edca883bf0d9567c19f9613d3b712f48c862f7b5 (patch) | |
tree | 66f65b51a0a944b1a7d666b10900956337d6d2dd /build_tools/bin | |
parent | eafde2d67cc813a6cc7794018ebf6d294c933f02 (diff) | |
download | linhes_dev-edca883bf0d9567c19f9613d3b712f48c862f7b5.zip |
reset_pacman_chroot.sh: initial inclusion
resets the installed packages back to default for a 'clean' chroot
Diffstat (limited to 'build_tools/bin')
-rwxr-xr-x | build_tools/bin/reset_pacman_chroot.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/build_tools/bin/reset_pacman_chroot.sh b/build_tools/bin/reset_pacman_chroot.sh new file mode 100755 index 0000000..3e75922 --- /dev/null +++ b/build_tools/bin/reset_pacman_chroot.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "Removing all but base..." +#pacman -R $(comm -23 <(pacman -Qq | sort) <((for i in $(pacman -Qqg base); do pactree -ul "$i"; done) | sort -u)) +#pacman -R $(comm -23 <(pacman -Qq | sort) <(( +pacman -Qq | sort > /tmp/allInstalled.reset +rm /tmp/baseDeps.reset +for i in $(pacman -Qqg base) +do + pactree -ul "$i" >> /tmp/baseDeps.reset +done +sort -u /tmp/baseDeps.reset > /tmp/baseDepsSorted.reset + +removePkgs="$(comm -23 /tmp/allInstalled.reset /tmp/baseDepsSorted.reset)" + +pacman -R --noconfirm $removePkgs + +#echo "Adding back other packages..." +pacman -S --noconfirm base-devel openssh git python2 dosfstools rsync squashfs-tools libisoburn python2-gitpython parched unison arch-install-scripts lynx python2-ndg-httpsclient wget findbrokenpkgs tig |