-
Junior Member
registered user
Remaster knoppix V6.2.1 - Remove LXDE install KDE - install2.sh
#!/bin/bash
#Functions
build2()
{
apt-get remove -y --purge openoffice.* #335M of disk space will be freed
apt-get autoremove -y
apt-get remove -y lxde*
apt-get remove -y lxappearance
apt-get remove -y lxpanel
apt-get remove -y lxsession-edit
apt-get remove -y lxshortcut
apt-get remove -y pcmanfm
apt-get remove -y compiz*
apt-get remove -y adriane*
apt-get remove -y gimp*
apt-get remove -y gpicview
apt-get remove -y synaptic
apt-get remove -y espeak*
apt-get remove -y libflite1*
apt-get remove -y leafpad*
apt-get remove -y vim-runtime*
apt-get remove -y ocropus*
apt-get remove -y icedove-l10n-de
apt-get remove -y iceweasel-l10n-de
apt-get remove -y virtualbox*
apt-get remove -y geoip-database
apt-get remove -y irssi
apt-get remove -y ncftp
apt-get remove -y rtorrent
apt-get remove -y gconf-editor
apt-get remove -y hplip*
apt-get remove -y mc
apt-get remove -y man-db
apt-get autoremove -y
clean1
dpkg -i --force-all /dpkg.deb
wget -O - http://backports.org/debian/archive.key | apt-key add -
apt-get update
aptitude -t lenny-backports install kde-core kdm
aptitude -t lenny-backports install kpackage
# apt-get remove -y `dpkg-query -l | grep i18n | grep kde | cut -d' ' -f3`
apt-get remove -y frozen-bubble*
apt-get remove -y gnome-utils*
apt-get remove -y smail
apt-get remove -y openbox-themes
apt-get autoremove -y
}
##
build3()
{
apt-get remove -y emacs21 emacs21-bin-common emacs21-common emacsen-common gettext-el zile
apt-get remove -y `dpkg-query -l | grep i18n | grep kde | cut -d' ' -f3`
apt-get remove -y --purge openoffice.* #298M of disk space will be freed
apt-get autoremove -y
clean1
}
####
clean1()
{
deborphan | xargs apt-get -y remove
# May need to run next line three times due to stab source package list errors
# deborphan | xargs apt-get -y remove
# deborphan --find-config | xargs dpkg --purge remove
# deborphan | xargs apt-get -y remove
# deborphan --find-config | xargs dpkg --purge remove
# deborphan | xargs apt-get -y remove
# deborphan --find-config | xargs dpkg --purge remove
COLUMNS=200 dpkg -l | grep ^rc | awk '{print $2} ' | xargs dpkg -P
apt-get autoremove -y
apt-get autoclean
apt-get clean
}
#Main#####
echo "Var1=${1} var2=${2} var3=${3} var4=${4} "
# ${1} ${extfilepath} ${targetpath} ${user}
echo "nameserver xxx.xxx.xxx.xx" >/etc/resolv.conf
route add default gw 192.168.1.254 eth0
route del default gw 192.168.1.1 eth0
lang=en
echo
echo prompt should be sh-3.1
echo
#read -p "in chroot passed var ${*} "
# Already mounted
mount -t proc /proc proc >/dev/null 2>&1
/etc/init.d/dbus start
/etc/init.d/acpid start
read -p "wip"
echo "Un-installing some packages , please wait..."
case ${1} in
2) build2;;
3) ;;
4) ;;
5) ;;
*) echo; read -p "Passed varibale ${1} Invailid Option"; exit;;
esac
# Installed packages
# http://wiki.linuxhelp.net/index.php/...t_Guide#Remove
# To provide list of all installed packages:
# dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}'
# apt-get remove openoffice-de-en manpages-de trans-de-en
# Starting X-based programs
export DISPLAY=localhost:0.0
export LANGUAGE=en
# \cp /usr/share/apps/ksplash/Themes/Default/locolor/* /usr/share/apps/ksplash/Themes/Default/
chown knoppix:knoppix -R /home/knoppix
#read -p "Pause"
echo
echo --------------------------------------------
#rm -rfv /etc/skel #2.6.28 work - Removed
#mv /home/knoppix /etc/skel #2.6.28 work - Removed
#chown -R root:root /etc/skel #2.6.28 work - Removed
#chown -R root:root /ramdisk || error "Unable to chown root:root -ramdisk"
echo
echo About to change user to knoppix: su knoppix
echo Prompt will change to 'knoppix1tty1:#'
echo
echo KDE will start via next script - install3.sh
echo
# chmod -Rv ugo+rw /tmp
chmod 777 /tmp
echo
#umount /media/${2}
# rmdir /media/${2}
X -configure > /dev/null 2>&1
\mv xorg.conf.new /etc/X11/xorg.conf
if [ "${1}" = "2" ] ; then
dpkg-reconfigure console-data
dpkg-reconfigure xserver-xorg
else
#su - knoppix -c "/install3.sh ${2}"
su - ${4} -c "/install3.sh ${2} ${4}"
fi
## KEYBOARD & MOUSE NOT working in KDE
# echo 'hald_enable="YES"' >> /etc/rc.conf
# echo 'dbus_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/hald onestart
# /usr/local/etc/rc.d/dbus onestart
# sudo umount -l /media/fd0 >/dev/null 2>&1
# sudo umount -l /mnt/fd0 >/dev/null 2>&1
# sudo umount -l /share1 >/dev/null 2>&1
# sudo umount -l /nfs1 >/dev/null 2>&1
# sudo umount -l /media/sda2 >/dev/null 2>&1
# sudo umount -l /media/sda3 >/dev/null 2>&1
# sudo umount -l /media/sda4 >/dev/null 2>&1
# sudo umount -l /media/${1} >/dev/null 2>&1
# if [ -d /media/sda2 ]; then sudo rm -rf /media/sda2; fi
# if [ -d /media/sda3 ]; then sudo rm -rf /media/sda3; fi
# if [ -d /media/sda4 ]; then sudo rm -rf /media/sda4; fi
# if [ -d /media/${1} ]; then sudo rm -rf /media/${1}; fi
# if [ -d /media/share1 ]; then sudo rm -rf /media/share1; fi
# if [ -d /media/nfs1 ]; then sudo rm -rf /media/nfs1; fi
##new end###
####
# start of script part b
####
echo
echo install2 active again
echo Make sure you have su root, make sure prompt is sh-3:
sudo umount -l /share1 >/dev/null 2>&1
sudo umount -l /nfs1 >/dev/null 2>&1
# rm /home/knoppix/.bash_history
rm -rf /tmp/*
rm -rf /.rr_moved
# Installing packages many logs and docs are created, If we need the space,
#rm -f /var/lib/apt/lists/*Packages
#rm -f /var/lib/apt/lists/*Release
#rm -f /var/lib/apt/lists/*Release.gpg
cp /var/lib/apt/lists/lock /
rm -f /var/lib/apt/lists/* 2>/dev/null
mv /lock /var/lib/apt/lists/
rm -f /var/lib/dpkg/*old
rm -f /var/cache/debconf/*old
rm -f /var/cache/apt/*bin
rm -f /var/cache/apt/archives/*.deb
# Optional
rm -rf /usr/share/doc/*
#clean1 #NEEDS ATTENTION, IF DO AUTOREMOVE AFTER INSTALLING NEW PACKAGES THEN THEY WILL BE REMOVED!!!
apt-get autoclean
apt-get clean
#read -p "Run only after install3.sh and changes have been made to the KDE"
# rm /etc/X11/xorg.conf
chmod 555 /tmp
umount /proc
umount /sys >/dev/null 2>&1
umount /dev >/dev/null 2>&1
# umount /mediasda4/knx/source/KNOPPIX/dev
exit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Mini Computer Vacuum USB Keyboard Cleaner PC Laptop Brush Dust Cleaning Kit NEW
$13.89

LEVOIT Cordless Vacuum Cleaner, Stick Vac with Tangle-Resistant Design, Up to...
$162.04

2-in-1 Compressed Air Duster & Vacuum, Brushless Motor, 320000RPM
$37.99

Cordless Air Duster & Vacuum Cleaner for Keyboard & PC Cleaning - 110000RPM Powe
$53.99

US Mini Computer Vacuum USB Keyboard Cleaner PC Laptop Brush Dust Cleaning Kits
$13.89

2 in 1 Compressed Air Duster Air Blower & Vacuum Cleaner Cordless Duster Blower
$16.99

Multifunctional Handheld Vacuum Cleaner & Blower for Keyboard/PC US SELLER
$39.99

Cordless Vacuum Cleaner for 20V Battery, 7-in-1 Lightweight Stick Vacu...
$149.15

Mini Computer Vacuum Cleaner & Compressed Air Duster 14500Pa, 110000RPM, Cordles
$53.99

Electric Air Duster Blower High Power Cordless Cleaner for PC Laptop Keyboard
$17.99