Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Lists items into individual files in working directory
- # PPAs (ppas)
- # user-installed apt packages (debs)
- # snap packages (snaps)
- # LuaRocks' rocks (rocks)
- # Flatpak apps (flatpaks)
- list_ppas () {
- for APT in `find /etc/apt/ -name \*.list`; do
- grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
- USER=`echo $ENTRY | cut -d/ -f4`
- PPA=`echo $ENTRY | cut -d/ -f5`
- echo sudo apt-add-repository ppa:$USER/$PPA
- done
- done
- }
- list_debs () {
- comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u)
- }
- list_ppas *> ./ppas
- list_debs *> ./debs
- if command -v snap; then snap list *> ./snaps; fi
- if command -v luarocks; then luarocks list *> ./rocks; fi
- if command -v flatpak; then flatpak list --app *> ./flatpaks; fi
Add Comment
Please, Sign In to add comment