Ubuntu 11.04 – Finaliser l’installation

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

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:

--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.
# -*- coding: utf-8 -*-

# =============================================================================
# Script for full system installation
# Author : Pascal Rapaz
# Version: 1.0.0
# Date   : 15.05.2010 Creation
#          01.09.2011 Current release
# 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
#   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

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

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

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

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

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

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

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

    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 alexandria indicator-multiload
    # internet
    printf "$GREEN" "[INSTALL]" "Internet applications"
    apt-get -y install flashplugin-nonfree chromium-browser

    printf "$GREEN" "[INSTALL]" "Office applications"
    apt-get -y install geany geany-plugins

    # 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

    # miscalenous
    printf "$GREEN" "[INSTALL]" "Miscalenous"
    apt-get -y install galculator tomboy grsync purrr cvs asciidoc fop gparted fslint python-wxgtk2.8 vim grub2-splashimages htop comixcursors

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

# 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 meld python-pyexiv2 glade libbluetooth-dev

    # 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 

    # Alexandria
    printf "$GREEN" "[ADD]" "Alexandria repository"
	add-apt-repository ppa:alexandria-team/ppa
    # System Load Indicator
    printf "$GREEN" "[ADD]" "System Load Indicator"
	add-apt-repository ppa:indicator-multiload/stable-daily 

# 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 ]
        printf "$RED" "[ERROR]" "You must have root privileges to run this command!"
        exit 1

# print help
function usage
    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 " 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 "  -h,   --help       Display this help then quit"

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

This entry was posted in Bash, 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 *