daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Oct 16th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. cat *.db.tar.gz | tar -tvz | grep -e "^d" | awk '{print $6}' | grep -Po "(.*)(?=-([^-]*)-([^-]*))" | sort -u > /tmp/pkgs-from-repo.txt
  3. pacman -Qqn > /tmp/pkgs-from-arch.txt
  4. sort /tmp/pkgs-from-arch.txt /tmp/pkgs-from-repo.txt | uniq -d | awk '{print "-o -name \""$1"*.tar.xz\""}' | xargs find -name "*.old" > /tmp/pkgs-rm.txt
  5. echo "[!] Removing: "
  6. cat /tmp/pkgs-rm.txt
  7. read -r -p "[?] Are you sure? [y/N] " U_SURE
  8. case "$U_SURE" in
  9.         [yY])
  10.                 cat /tmp/pkgs-rm.txt | xargs repo-remove *.db.tar.gz
  11.                 cat /tmp/pkgs-rm.txt | xargs rm
  12. esac
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top