Ubuntu 11.10 – Finaliser l’installation


Warning: mysql_get_server_info(): No such file or directory in /home/clients/010ea5ad3c328402f82542a589e1347c/web/wp-content/plugins/xml-google-maps/xmlgooglemaps_dbfunctions.php on line 10

Warning: mysql_get_server_info(): A link to the server could not be established in /home/clients/010ea5ad3c328402f82542a589e1347c/web/wp-content/plugins/xml-google-maps/xmlgooglemaps_dbfunctions.php on line 10

Le script ci-après complète une installation standard d’Ubuntu avec les applications que j’utilise régulièrement.

Syntaxe:
sudo bash install.sh [options]

Sans options d’exécution, uniquement les applications communes à toutes les architectures sont installées. Il est toutefois possible de compléter l’installation des modules communs par le truchement des options suivantes:

Options
--nocommon N’installe pas les applications communes à toutes les architectures.
--noupdate N’effectue pas le nettoyage et la mise à jour de la liste des packages (apt).
--dev Installe les applications communes ainsi que les outils de développement
-r, --repos Ajoute les dépôts nécessaires pour certaines applications ou pour obtenir des logiciels en cours de développement.
-x, --xps Installe les applications communes, les outils de développement ainsi que certaines applications spécifiques pour un PC Dell XPS.
-h, --help Affiche l’aide et quitte.
#!/bin/bash
# -*- coding: utf-8 -*-

##
# =============================================================================
# Script for full system installation
#
# Author : Pascal Rapaz
# Version: 1.0.0
# Date   : 15.05.2010 Creation
#          01.09.2011 Ubuntu 11.04
#          18.10.2011 Ubuntu 11.10
#
# License: GPL-2+
#   This package is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This package is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   If you need the GNU General Public License write to:
#     Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
#     MA 02110-1301, USA.
#
# (c) 2010-2011, Pascal Rapaz (RapazP - pascal.rapaz@rapazp.ch)
# =============================================================================
##

RED="\033[1;31m%10s %s\033[0m\n"
GREEN="\033[1;32m%10s %s\033[0m\n"
BLUE="\033[1;34m%10s %s\033[0m\n"

# execute the installation script
function launchInstall
{
    _isSuperUser

    printf "$BLUE" "[START]" "Installation script"

    if [ "$repos" = "y" ]; then
        _aptList
    fi

    if [ "$update" = "y" ]; then
        _update
    fi

    if [ "$common" = "y" ]; then
        common
    fi

    if [ "$development" = "y" ]; then
        development
    fi

    if [ "$xps" = "y" ]; then
        xps
    fi

    if [ "$update" = "y" ]; then
        _clean
    fi

    printf "$BLUE" "[END]" "Installation script"
}

# install common applications for all systems
function common
{
    ###
    # Install applications from custom repositories or from default repositories
    printf "$GREEN" "[INSTALL]" "Custom repos installation"
    apt-get -y install banshee indicator-multiload
    ###
    
    # internet
    printf "$GREEN" "[INSTALL]" "Internet applications"
    apt-get -y install adobe-flashplugin chromium-browser

    printf "$GREEN" "[INSTALL]" "Office applications"
    apt-get -y install geany geany-plugins vim tellico libreoffice-java-common

    # photo
    printf "$GREEN" "[INSTALL]" "Image manipulation"
    apt-get -y install geeqie gthumb inkscape pinta gimp gimp-help-fr shutter

    # audio
    printf "$GREEN" "[INSTALL]" "Audio manipulation"
    apt-get -y install audacious audacious-plugins lame audacity easytag normalize-audio sound-juicer

    # video and graphics
    printf "$GREEN" "[INSTALL]" "Video manipulation and graphics tools"
    apt-get -y install vlc mplayer mencoder ffmpeg

    # video codecs
    printf "$GREEN" "[INSTALL]" "Video codecs"
    apt-get -y install gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad

    # network
    #    keyutils is necessary for Samba DFS support
    printf "$GREEN" "[INSTALL]" "Network application"
    apt-get -y install samba smbfs keyutils ssh gnome-rdp xtightvncviewer vinagre vino network-manager-vpnc

    # archive manager
    printf "$GREEN" "[INSTALL]" "Archive manager"
    apt-get -y install unace rar p7zip-full

    # system
    printf "$GREEN" "[INSTALL]" "System tools"
    apt-get -y install gconf-editor dconf-tools synaptic gparted htop lvm2 gnome-tweak-tool gnome-schedule


    # miscalenous
    printf "$GREEN" "[INSTALL]" "Miscalenous"
    apt-get -y install galculator grsync purrr asciidoc fop fslint python-wxgtk2.8 comixcursors

    printf "$BLUE" "[INFO]" "Following applications must be added manually:"
    printf "$BLUE" "" "ubuntu-tweak DBVisualizer Eclipse Jajuk Opera Nero VirtualBox Dropbox"
}

# install particular applications for XPS
function xps
{
    # G15 LCD
    printf "$GREEN" "[INSTALL]" "Logitech G15 LCD screen"
    apt-get -y install g15composer g15daemon g15stats
}

# install applications for development
function development
{
    # dev
    printf "$GREEN" "[INSTALL]" "Development"
    apt-get -y install sun-java6-jdk sun-java6-plugin ia32-sun-java6-bin meld python-pyexiv2 glade libbluetooth-dev subversion #rabbitvcs-nautilus

    # debian packages
    printf "$GREEN" "[INSTALL]" "Tools for debian packages creation"
    apt-get -y install build-essential dpkg-dev debhelper devscripts fakeroot alien

    # network security
    printf "$GREEN" "[INSTALL]" "Network security"
    apt-get -y install aircrack-ng kismet zenmap
    
    # language
    printf "$GREEN" "[INSTALL]" "Language support"
    apt-get -y install manpages-fr-extra manpages-fr-dev
}

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Packages management
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# create apt list for specific applications
function _aptList
{
    printf "$GREEN" "[INFO]" "add specific repositories"

    # Banshee
    printf "$GREEN" "[ADD]" "Banshee unstable"
    add-apt-repository ppa:banshee-team/banshee-unstable 

    # System Load Indicator
    printf "$GREEN" "[ADD]" "System Load Indicator"
    add-apt-repository ppa:indicator-multiload/stable-daily 
    
    # Chromium daily
    printf "$GREEN" "[ADD]" "Chromium daily"
    add-apt-repository ppa:chromium-daily/ppa 
    
    # oracle Java
    printf "$GREEN" "[ADD]" "Oracle Java 6"
    add-apt-repository ppa:ferramroberto/java
    
    # RabbitVCS for Subversion
#    printf "$GREEN" "[ADD]" "Subversion in nautilus"
#    add-apt-repository ppa:rabbitvcs/ppa
}

# update repository
function _update
{
    printf "$GREEN" "[CLEAN]" "update packages list"
    apt-get update
}

# clean repository
function _clean
{
    printf "$GREEN" "[CLEAN]" "Remove packages there is no longer requiered"
    apt-get -y autoremove
}

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Helper functions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Check if user are in su mode
function _isSuperUser
{
    # Test if you're in super-user mode
    if [ ! `id -u` -eq 0 ]
    then
        printf "$RED" "[ERROR]" "You must have root privileges to run this command!"
        exit 1
    fi
}

# print help
function usage
{
    echo
    echo "Usage: sudo bash install.sh [OPTION] "
    echo "Complete the ubuntu standard installation with custom applications"
    echo "Without any options, install only common applications"
    echo
    echo " Parameters:"
    echo "      --nocommon     Don't install common applications"
    echo "      --noupdate     Don't update or clean apt package list"
    echo "      --dev          Install common and development applications"
    echo "  -r, --repos        Add some repositories"
    echo "  -x, --xps          Install common, development and XPS specific applications"
    echo
    echo "  -h,   --help       Display this help then quit"
}

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Launch part
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# retrieve command parameters
common=y
update=y
while [ "$1" != "" ]; do
    case $1 in
        --nocommon )  common=n
                      ;;
        --noupdate )  update=n
                      ;;
        --dev )       development=y
                      ;;
        -r | --repos ) repos=y
                       ;;
        -x | --xps )  xps=y
                      development=y
                      ;;
        -h | --help ) usage
                      exit
                      ;;
    esac
    shift
done

launchInstall
This entry was posted in GNU/Linux, Ubuntu and tagged , , , , . Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Your email address will not be published. Required fields are marked *