01 April 2005

Automate Script for New Users (ubuntu-geek)

http://www.ubuntuforums.org/showthread.php?t=22646

By UBUNTU-GEEK

Purpose:
To automate installation of the following programs because I am lazy and hate selecting to install them manually after I format my computer (which is often) so this script saves me alot of time and I hope it helps you too.

Open a terminal session and enter:
wget http://download.ubuntuforums.org/ubuntusetup/ubuntusetup.sh
sudo sh ubuntusetup.sh

#!/bin/bash
#
# +*** WARNING WARNING WARNING WARNING WARNING ***
# ----------------------------------------------
# | ryan (ubuntu-geek) / site@ubuntuforums.org |
# | Purpose of this script is to automate/tweak setting up a new ubuntu system.|
# | |
# | This script installs 3rd party programs and are not supported by canonical/ubuntu. # | If this script blows up your installation it's not my fault :) |
# | |
# | This script has been tested on Hoary Hedgehog 5.04. |
# | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
# | This script will perform the following functions. |
# | 1. Install beep-media-player, gstreamer0.8-mad (for mp3's) |
# | 2. Enable debian-marillat, universe and multiverse repo's |
# | 3. Install latest java and enable java in firefox |
# | 4. Give you nice forms in firefox |
# | 5. Install streamtuner |
# | 6. Install msttcorefonts |
# | 7. Install latest acrobat reader and firefox plugin |
# | 8. Install dvd playback support |
# | 9. Install w32codecs and dvd libraries |
# | 10. Install gnomebaker |
# +----------------------------------------------------------------------------+
### global options ###
wget="/usr/bin/wget"
apt="/usr/bin/apt-get"
core_packages="build-essential"
media_packages="beep-media-player gstreamer0.8-mad w32codecs streamtuner xine-ui totem-xine"
misc_packages="msttcorefonts acroread acroread-plugin libdvdcss2 gnomebaker gftp flashplayer-mozilla"
java_jre_url="http://download.ubuntuforums.org/ubuntusetup/jre-1_5_0_02-linux-i586.bin"
firefox_forms="http://download.ubuntuforums.org/ubuntusetup/ff-forms.tar.gz"
sources_list_url="http://download.ubuntuforums.org/ubuntusetup/sources.list"
misc_fonts_url="http://download.ubuntuforums.org/ubuntusetup/miscfonts.tar.gz"


### functions ###
check_errs()
{
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
exit ${1}
fi
}
### main script starts here ###


### snag the updated sources.list


cd /etc/apt/ && mv sources.list sources.list.orig && ${wget} ${sources_list_url}gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 1F41B907
gpg --armor --export 1F41B907 | sudo apt-key add -
check_errs $? "There was an error downloading the sources.list."
sleep 5


### lets update the apt repo
${apt} update
check_errs $? "There was an error in apt-get update."
sleep 5


### lets install build-esstential
echo "Additional packages maybe need to be installed select yes if asked"
${apt} install ${core_packages}
check_errs $? "There was an error in ${core_packages} installation."
sleep 5


### lets install media_packages
echo "Additional packages maybe need to be installed select yes if asked"
${apt} install ${media_packages}
check_errs $? "There was an error in ${media_packages} installation."
sleep 5


### lets install misc_packages
echo "Additional packages maybe need to be installed select yes if asked"
${apt} install ${misc_packages}
check_errs $? "There was an error in ${misc_packages} installation."
sleep 5


### lets install misc windows fonts that are not in the msttcorefonts package
echo "Installing Misc fonts"
cd /usr/share/fonts/truetype/msttcorefonts
${wget} ${misc_fonts_url}
tar xvzf miscfonts.tar.gz
rm -f miscfonts.tar.gz
check_errs $? "Misc Fonts Installation has failed..."
sleep 5


### lets install firefox forms
echo "Installing firefox forms"
cd /usr/lib/mozilla-firefox/
${wget} ${firefox_forms}
tar xvzf ff-forms.tar.gz
rm -f ff-forms.tar.gz
check_errs $? "Firefox forms Installation has failed..."
sleep 5


### lets install java
echo "Installing java"
mkdir /usr/java && cd /usr/java
${wget} ${java_jre_url}
sh jre-1_5_0_02-linux-i586.bin
chown -R root:root /usr/java/jre1.5.0_02/
ln -s /usr/java/jre1.5.0_02/bin/java /usr/bin/java
ln -s /usr/java/jre1.5.0_02/bin/java_vm /usr/bin/java_vm
ln -s /usr/java/jre1.5.0_02/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/
ln -s /usr/java/jre1.5.0_02/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla-firefox/plugins/
check_errs $? "Java Installation has failed..."
sleep 5


echo "If you made it this far job well done."

revisi 10.10.11-01