Submitted scripts and programs
Forum rules
Your own work only.
-
machinebacon
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
-
Contact:
Unread post
by machinebacon » Wed Jan 29, 2014 7:02 pm
The script prevents packages that depend on libgtk-3-0 from being installed. No more segfaults, no more bloat.
Code: Select all
#!/bin/bash
# Prevents gtk3-applications from being installed
# written for the grill by machinebacon 2014/01/30
# released under the beard-wearer/pipe-smoker license
INPUT=/tmp/input.$$
if [[ $UID -ne 0 ]]; then
echo "$0 must be run as root"
exit 1
fi
createblock(){
cat <<EOF >> /etc/apt/preferences.d/11grillmeister
Package: libgtk-3-0
Pin: release *
Pin-Priority: -1
EOF
echo "gtk3 now blocked. Well done!"
exit 0
}
removeblock(){
rm /etc/apt/preferences.d/11grillmeister
echo "gtk3 applications can be installed. Bye!"
}
dialog --backtitle "LinuxBBQ Grillmeister" --title "Prevent GTK3-packages from being installed." --menu " " 0 0 0 y "create preferences file" n "remove preferences file" x "Exit" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
y) createblock ;;
n) removeblock ;;
x) exit 0 ;;
esac
..gnutella..
-
mrneilypops
- Bad Advice Dog
- Posts: 143
- Joined: Wed Oct 17, 2012 9:15 pm
- Location: Luxembourg
-
Contact:
Unread post
by mrneilypops » Wed Jan 29, 2014 7:05 pm
Super cool Man!
Gotta give this a try...
-
machinebacon
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
-
Contact:
Unread post
by machinebacon » Wed Jan 29, 2014 7:16 pm
Keep in mind, it only blocks libgtk-3-0 -- to be more restrictive, change it to libgtk-3-*
..gnutella..
-
GekkoP
- Emacs Sancho Panza
- Posts: 5878
- Joined: Tue Sep 03, 2013 7:05 am
Unread post
by GekkoP » Sat Feb 01, 2014 11:26 am
Late to the party, but thanks for this. Got a couple of machine where this will be useful.