- #!/bin/bash
- # To install this file: download it by saving it to your desktop, or wherever.
- # Then, right-click the file, click Properties, and choose the Permissions tab.
- # Check off "Allow Executing File as Program".
- # Now, just run the file in terminal.
- # For example:
- # cd ~/Desktop
- # ./perfectbuntu
- # Now for the code. Don't worry about any of this stuff. It's just nonsense. ;)
- echo
- echo perfectbuntu
- echo SCRIPT VERSION 2.1
- echo By Robbie Ferguson \(www.Category5.TV\)
- echo This script was originally based on http://www.category5.tv/content/view/77/38/
- echo
- # Detect version of Ubuntu
- grep "DISTRIB_RELEASE=8.04" /etc/lsb-release > /dev/null 2>&1
- if [ $? = 0 ]; then
- OSVER="hardy"
- fi
- grep "DISTRIB_RELEASE=8.10" /etc/lsb-release > /dev/null 2>&1
- if [ $? = 0 ]; then
- OSVER="intrepid"
- fi
- grep "DISTRIB_RELEASE=9.04" /etc/lsb-release > /dev/null 2>&1
- if [ $? = 0 ]; then
- OSVER="jaunty"
- fi
- # set default bit to 32
- BIT="32"
- if [[ `uname -m` == 'amd64' || `uname -m` == 'x86_64' ]]; then
- BIT="64"
- fi
- echo "Detected version:" $OSVER, $BIT"-bit"
- if [[ $OSVER != 'hardy' && $OSVER != 'intrepid' && $OSVER != 'jaunty' ]]; then
- echo "Your version of Linux is not supported."
- echo
- exit
- fi
- # Running a supported version of *buntu. Move on.
- echo
- echo This script requires super-user access to continue.
- echo Checking for super-user access...
- #sleep 5
- sudo echo Access Granted.
- echo I might have to ask for your password again...
- echo
- echo Now, I\'ll ask you a bunch of questions, and then get right to work.
- echo
- # Ask all the questions...
- echo "Installing restricted multimedia codecs might violate"
- echo "patent and/or other laws. Please make sure you have"
- echo "the right to use these codecs."
- echo
- read -p "Install Multimedia Codecs and Restricted Extras? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- MULTIMEDIA="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- MULTIMEDIA="1"
- fi
- echo
- echo "I can install and configure the Flash plugin for you."
- echo "First, I'll close your browser..."
- echo "Then I'll remove your old Flash plugin..."
- echo "Then I'll install the new Flash plugin."
- echo
- read -p "Do you want me to do that (Flash Plugin)? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- FLASH="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- FLASH="1"
- fi
- echo
- read -p "Does your computer have a DVD player? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- DVD="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- DVD="1"
- fi
- echo
- read -p "Do you want spam filters for Evolution? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- SPAM="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- SPAM="1"
- fi
- echo
- echo I can install a huge number of fonts which you can use in
- echo your word processor, or even in programs like The GIMP.
- read -p "Would you like a bunch of new fonts? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- FONTS="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- FONTS="1"
- fi
- echo
- echo wine is an application that allows you to run some
- echo Windows programs directly in Linux \(.exe files\).
- read -p "Should I install this for you? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- WINE="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- WINE="1"
- fi
- echo
- echo Avant is a very nice dockbar for Linux.
- echo Would you like avant-window-navigator?
- read -p "Should I install this for you? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- AWN="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- AWN="1"
- fi
- echo
- read -p "Should I install Skype for you? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- SKYPE="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- SKYPE="1"
- fi
- echo
- echo "I can make it so you can use 7z, ZIP, Zip64, CAB, RAR, ARJ,"
- echo "GZIP, BZIP2, TAR, CPIO, RPM, ISO and DEB archives in file-roller."
- read -p "Do you want me to do this? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- COMPRESSION="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- COMPRESSION="1"
- fi
- echo
- echo This script does not come with or even imply any kind of warranty.
- echo If your system breaks, you take full responsibility.
- read -p "I am about to modify your system. Are you sure this is okay? (Y/N) "
- if [ "$REPLY" = "y" ] ; then
- GO="1"
- fi
- if [ "$REPLY" = "Y" ] ; then
- GO="1"
- fi
- if [ "$REPLY" = "N" ] ; then
- echo Exiting.
- fi
- if [ "$REPLY" = "n" ] ; then
- echo Exiting.
- fi
- echo
- # End of questions
- # Only proceed if the user accepted the brief "you break it, it's your fault" disclaimer
- if [ "$GO" = "1" ]; then
- cd ~
- if [ ! -e ".perfectbuntu/datafile10" ] # Check if file exists.
- then
- echo This is apparently the first time you have run this script.
- echo
- echo Backing up your APT sources.list file to /etc/apt/sources.list.backup...
- sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
- echo Done.
- echo
- echo Creating your APT entries now.
- mkdir ~/.perfectbuntu
- echo "Do not delete this file." >> ~/.perfectbuntu/datafile10
- echo "" >> ~/.perfectbuntu/sources10
- echo "# Added by perfectbuntu - www.category5.tv" >> ~/.perfectbuntu/sources10
- # Avoid duplicates by using grep
- if grep 'main restricted universe multiverse'$ /etc/apt/sources.list > /dev/null; then
- echo "Omitting duplicate..."
- else
- echo "deb http://ca.archive.ubuntu.com/ubuntu/ "$OSVER" main restricted universe multiverse" >> ~/.perfectbuntu/sources10
- fi
- if grep 'main restricted'$ /etc/apt/sources.list > /dev/null; then
- echo "Omitting duplicate..."
- else
- echo "deb-src http://ca.archive.ubuntu.com/ubuntu/ "$OSVER" main restricted" >> ~/.perfectbuntu/sources10
- fi
- if grep 'free non-free'$ /etc/apt/sources.list > /dev/null; then
- echo "Omitting duplicate..."
- else
- echo "deb http://packages.medibuntu.org/ "$OSVER" free non-free" >> ~/.perfectbuntu/sources10
- fi
- if grep 'deb http://ppa.launchpad.net/reacocard-awn/ubuntu '$OSVER' main'$ /etc/apt/sources.list > /dev/null; then
- echo "Omitting duplicate..."
- else
- echo "deb http://ppa.launchpad.net/reacocard-awn/ubuntu "$OSVER" main" >> ~/.perfectbuntu/sources10
- fi
- if grep 'deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu '$OSVER' main'$ /etc/apt/sources.list > /dev/null; then
- echo "Omitting duplicate..."
- else
- echo "deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu "$OSVER" main" >> ~/.perfectbuntu/sources10
- fi
- cat ~/.perfectbuntu/sources10 | sudo tee -a /etc/apt/sources.list
- echo Done.
- echo
- fi
- echo Retrieving GPG Signatures...
- sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list; sudo apt-get -q update; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring; sudo apt-get -q update
- echo Done.
- echo
- echo Cleaning up apt...
- sudo apt-get clean
- echo Done.
- echo
- echo Updating apt...
- sudo apt-get update
- echo Done.
- echo
- #Run the installers
- if [ "$FLASH" = "1" ]; then
- echo Closing your browser windows...
- killall -9 firefox
- echo Removing your old Flash plugin...
- sudo apt-get --force-yes -y -f -m --purge remove flashplugin-nonfree adobe-flashplugin flashplugin-installer
- echo Installing Flash plugin installer...
- sudo apt-get --force-yes -y -f -m install flashplugin-installer
- echo Done.
- echo
- fi
- if [ "$MULTIMEDIA" = "1" ]; then
- echo Installing multimedia codecs...
- sudo apt-get --force-yes -y -f -m install ubuntu-restricted-extras
- sudo apt-get --force-yes -y -f -m install gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg libxine1-ffmpeg libdvdread3
- sudo apt-get -y -f -m install "w"$BIT"codecs"
- echo Done.
- echo
- fi
- if [ "$FONTS" = "1" ]; then
- echo Installing roughly a billion fonts...
- sudo apt-get -y -f -m install msttcorefonts
- echo
- echo NOTE: That should be the last EULA you\'ll have to deal with.
- echo You can go get a coffee now while I finish up.
- echo It\'s going to take a while.
- echo
- echo Continuing with font installations...
- sudo apt-get -y -f -m install ttf-gentium ttf-dustin ttf-georgewilliams ttf-sjfonts sun-java6-fonts ttf-larabie-deco ttf-larabie-straight ttf-larabie-uncommon ttf-linux-libertine ttf-mgopen ttf-sil-charis ttf-sil-doulos ttf-ubuntu-title gsfonts-x11 ttf-fifthhorseman-dkg-handwriting ttf-alee ttf-alee ttf-ancient-fonts ttf-arhangai ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-ukai ttf-atarismall ttf-baekmuk ttf-bengali-fonts ttf-beteckna ttf-bpg-georgian-fonts ttf-breip ttf-devanagari-fonts ttf-dzongkha ttf-ecolier-court ttf-essays1743 ttf-f500 ttf-farsiweb ttf-freefarsi ttf-gfs-artemisia ttf-gfs-bodoni-classic ttf-gfs-complutum ttf-gfs-didot-classic ttf-gfs-gazis ttf-gfs-neohellenic ttf-gfs-solomos ttf-gfs-theokritos ttf-gujarati-fonts ttf-inconsolata ttf-indic-fonts ttf-isabella ttf-junicode ttf-kacst ttf-kannada-fonts ttf-khmeros ttf-kiloji ttf-kochi-gothic-naga10 ttf-kochi-mincho-naga10 ttf-konatu ttf-liberation ttf-manchufont ttf-marvosym ttf-mikachan ttf-mona ttf-mph-2b-damase ttf-nafees ttf-ocr-a ttf-oflb-euterpe ttf-oriya-fonts ttf-paktype ttf-punjabi-fonts ttf-radisnoir ttf-sazanami-gothic ttf-sazanami-mincho ttf-sil-abyssinica ttf-sil-andika ttf-sil-ezra ttf-sil-padauk ttf-sil-scheherazade ttf-sil-yi ttf-staypuft ttf-summersby ttf-tamil-fonts ttf-tmuni ttf-tuffy ttf-unfonts ttf-unfonts-extra ttf-uralic ttf-vlgothic ttf-wqy-zenhei ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac
- echo Done.
- echo
- fi
- if [ "$DVD" = "1" ]; then
- echo Installing DVD decoders and support files...
- sudo apt-get -y -f -m install libdvdcss2 libdvdread3 ffmpeg "w"$BIT"codecs"
- echo Done.
- echo
- fi
- if [ "$AWN" = "1" ]; then
- echo Installing avant-window-navigator Dockbar...
- # Used to install the BZR, but now the stable version has been updated so it's not necessary
- #sudo apt-get --force-yes -y -f -m install awn-manager-bzr
- #sudo apt-get --force-yes -y -f -m install avant-window-navigator-bzr avant-window-navigator-data
- # Install the stable version instead
- sudo apt-get --force-yes -y -f -m install avant-window-navigator awn-applets-c-extras awn-manager
- echo Done.
- echo
- fi
- if [ "$COMPRESSION" = "1" ]; then
- echo Installing support for multiple archive types in file-roller...
- sudo apt-get -y -f -m install lzma unrar rar p7zip p7zip-full p7zip-rar
- echo Done.
- echo
- fi
- if [ "$WINE" = "1" ]; then
- echo Installing wine...
- sudo apt-get -y -f -m install wine
- echo Done.
- echo
- fi
- if [ "$SKYPE" = "1" ]; then
- echo Installing Skype...
- sudo apt-get -y -f -m install skype
- echo Done.
- echo
- fi
- if [ "$SPAM" = "1" ]; then
- echo Installing SPAM filters...
- sudo apt-get -y -f -m install spamassassin
- echo Done.
- echo
- fi
- # Install stuff that everyone should have (no prompt)
- # xnest updates Terminal Server Client to support the XDMCP protocol allowing you to connect to other Linux machines. It's strange this isn't included out-of-the-box.
- echo "I'm going to install some things that everyone should have..."
- echo
- echo "Installing support for XDMCP (remote desktop for Linux, essentially)..."
- sudo apt-get -y -f -m install xnest
- echo Done.
- echo
- # CCSM allows you to customize your special effects and all settings in Compiz.
- echo Installing CCSM advanced visual effects for Compiz Fusion...
- sudo apt-get -y -f -m install compizconfig-settings-manager
- echo Done.
- echo
- echo All done. Enjoy the Perfect *buntu!
- echo Visit www.category5.tv/content/view/164/77
- fi
