-
Notifications
You must be signed in to change notification settings - Fork 3
/
uninstall-garbage-packages
29 lines (24 loc) · 1.9 KB
/
uninstall-garbage-packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# uninstall-garbage-packages
# Cleanup - Uninstall garbage Gnome and Ubuntu packages
# Uninstall some garbage packages e.g. orca, shotwell, rhythmbox, totem, transmission
echo -e "Running: Cleanup - Uninstall garbage Gnome and Ubuntu packages - ./scripts/uninstall-garbage-packages"
sudo apt-get remove -y --purge aisleriot branding-ubuntu cheese deja-dup example-content gnome-calendar gnome-initial-setup gnome-mahjongg gnome-mines gnome-shell-extension-appindicator gnome-sudoku gnome-todo gnome-todo-common libgnome-todo orca remmina remmina-common remmina-plugin-rdp remmina-plugin-secret remmina-plugin-vnc rhythmbox rhythmbox-data rhythmbox-plugin-alternative-toolbar rhythmbox-plugins shotwell shotwell-common simple-scan totem totem-common totem-plugins transmission-common transmission-gtk ubuntu-desktop ubuntu-report usb-creator-gtk vino zeitgeist-core &&
# Get system language (locale)
SYS_LANGUAGE=`locale | grep LANG | cut -d= -f2 | cut -d_ -f1`
## Solve problem when locale is not set at all
if [[ $SYS_LANGUAGE == "C.UTF-8" ]] ; then
SYS_LANGUAGE="en"
fi
# uninstall non-english language packages
sudo apt-get remove -y --purge `dpkg-query -W --showformat='${Package}\n' | grep language-pack | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"` &&
sudo apt-get remove -y --purge `dpkg-query -W --showformat='${Package}\n' | grep firefox-locale | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"` &&
sudo apt-get remove -y --purge `dpkg-query -W --showformat='${Package}\n' | grep thunderbird-locale | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"` &&
sudo apt-get remove -y --purge `dpkg-query -W --showformat='${Package}\n' | grep libreoffice-help | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"` &&
sudo apt-get remove -y --purge `dpkg-query -W --showformat='${Package}\n' | grep libreoffice-l10n | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"`
if [ $? -eq 0 ]; then
echo -e "\\nOK\\n"
exit 0
else
echo -e "\\nFAIL\\n"
exit 1
fi