Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List info on installed applications (Read only)
#!/bin/bash
# Download and run:
# curl -o- [raw gist url] | bash
function list_installed () {
comm -23 \
<(apt-mark showmanual | sort -u) \
<(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u)
}
echo "# Sources:"
grep -r --include '*.list' '^deb ' /etc/apt/ | \
grep -v 'ubuntu.com' | \
grep -v 'launchpad.net/elementary-os' | \
grep -v 'elementary.io' | \
sed -re 's/^\/etc\/apt\/sources\.list((\.d\/)?|(:)?)//' \
-e 's/(.*\.list):/\[\1\] /' \
-e 's/deb http:\/\/ppa.launchpad.net\/(.*?)\/ubuntu .*/ppa:\1/'
echo ""
echo "# Manually installed packages:"
list_installed
echo ""
echo "sudo apt install $(list_installed | tr '\n' ' ')"
echo ""
echo "# Snaps:"
snap list
echo ""
echo "Install:"
echo "$ snap install [app id]"
echo ""
echo "# Flatpak remotes:"
flatpak remotes -d
echo ""
echo "Add remote:"
echo "$ flatpak remote-add --if-not-exists [name] [url]"
echo ""
echo "# Flatpak installed:"
flatpak list -d
echo ""
echo "Install: "
echo "$ flatpak install [remote] [app id]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.