Last active
January 10, 2018 11:53
-
-
Save NoxWings/3b1b31af7af3bfbab94a3d800bd88643 to your computer and use it in GitHub Desktop.
Raspbian remove bloat software
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------- | |
# Install base software | |
# --------------------- | |
# Install node LTS | |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
sudo aptitude install -y nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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