Skip to content

Instantly share code, notes, and snippets.

@NoxWings
Last active January 10, 2018 11:53
Show Gist options
  • Save NoxWings/3b1b31af7af3bfbab94a3d800bd88643 to your computer and use it in GitHub Desktop.
Save NoxWings/3b1b31af7af3bfbab94a3d800bd88643 to your computer and use it in GitHub Desktop.
Raspbian remove bloat software
# ---------------------
# Install base software
# ---------------------
# Install node LTS
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo aptitude install -y nodejs
#!/bin/bash
# Backup initial packages
# http://aptitude.alioth.debian.org/doc/en/ch02s04s05.html#tableSearchTermQuickGuide
aptitude search '!~M ~i' > initial-packages.txt
PACKAGES=(`aptitude search '!~M ~i' | awk '{ print $2 }'`)
# ----------------
# Remove bloatware
# ----------------
function findCandidates {
candidates=()
for package in "${PACKAGES[@]}"
do
for name in "$@"
do
case "$package" in *"$name"*)
candidates+=("$package")
break
;;
esac
done
done
}
findCandidates "bluej" "claws-mail" "dillo" "epiphany-browser" "geany" "greenfoot" "idle" "libreoffice" "minecraft" "nodered" "oracle-java" "open-jdk" "scratch" "sonic-pi" "thonny" "wolfram-engine"
echo "The following ${#candidates[@]} manually installed packages will be removed:"
echo " ${candidates[@]}"
echo ""
sudo aptitude purge -y ${candidates[@]}
# Autoremove & clean
sudo apt-get autoremove -y
sudo apt-get autoclean -y
# Update
sudo aptitude update
sudo aptitude full-upgrade -y
# Remove folder structure
rm -rf ~/python_games
rm -rf ~/Documents
rm -rf ~/Music
rm -rf ~/Public
rm -rf ~/Pictures
rm -rf ~/Templates
rm -rf ~/Videos
rm -rf ~/Scratch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment