J'ai constaté par le passé que le fait d'enchaîner les commandes de cette manière entraînait des problèmes si l'une d'entre elles avait un "hoquet".
Par exemple, si votre commande est similaire à celle-ci :
sudo apt-get install 1 2 3 4
ensuite, s'il y a une erreur dans le programme 3, le programme 4 ne s'installera pas. Le fait de les séparer sur chaque ligne résout ce problème. S'il y a une erreur, le script continue.
Voici un exemple de script que j'utilise pour les nouvelles installations :
echo " "
echo "Please run this in an empty folder. Failure to do so may cause data loss!"
read -p "Press ENTER to continue, or close the window to abort."
echo " "
echo "Now backing up the sources list."
read -p "Press ENTER to continue..."
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo " "
echo "Now adding all the new repositories and keys."
read -p "Press ENTER to continue..."
sudo add-apt-repository -y "ppa:maarten-baert/simplescreenrecorder"
sudo add-apt-repository -y "deb http://download.videolan.org/pub/debian/stable/ /"
sudo add-apt-repository -y "ppa:stebbins/handbrake-releases"
sudo add-apt-repository -y "ppa:tsbarnes/indicator-keylock"
sudo add-apt-repository -y "ppa:freefilesync/ffs"
sudo add-apt-repository -y "deb http://apt.insynchq.com/ubuntu trusty non-free contrib"
sudo apt-add-repository -y "ppa:rael-gc/scudcloud"
wget -qO - https://d2t3ff60b2tol4.cloudfront.net/services@insynchq.com.gpg.key \ | sudo apt-key add -
wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc | sudo apt-key add -
echo " "
echo "Now removing all the programs I never use"
read -p "Press ENTER to continue..."
sudo apt-get autoremove -y abiword
sudo apt-get autoremove -y gnumeric
sudo apt-get autoremove -y firefox
sudo apt-get autoremove -y gmusicbrowser
sudo apt-get autoremove -y parole
sudo apt-get update
echo " "
echo "Now installing everything I use."
read -p "Press ENTER to continue..."
sudo apt-get install -y gdebi
sudo apt-get install -y screen
sudo apt-get install -y openvpn
sudo apt-get install -y openjdk-7-jre
sudo apt-get install -y guake
sudo apt-get install -y libreoffice
sudo apt-get install -y audacity
sudo apt-get install -y synaptic
sudo apt-get install -y moc
sudo apt-get install -y p7zip-full
sudo apt-get install -y mtools
sudo apt-get install -y mono-runtime
sudo apt-get install -y wine
sudo apt-get install -y aisleriot
sudo apt-get install -y gparted
sudo apt-get install -y tango-icon-theme
sudo apt-get install -y tango-icon-theme-extras
sudo apt-get install -y thunderbird
sudo apt-get install -y htop
sudo apt-get install -y xscreensaver
sudo apt-get install -y python-pygame
sudo apt-get install -y gimp
sudo apt-get install -y xterm
sudo apt-get install -y indicator-keylock
sudo apt-get install -y libdvdcss2
sudo apt-get install -y vlc
sudo apt-get install -y handbrake-gtk
sudo apt-get install -y openshot
sudo apt-get install -y openshot-doc
sudo apt-get install -y simplescreenrecorder
sudo apt-get install -y freefilesync
sudo apt-get install -y mono-devel
sudo apt-get install -y pinta
sudo apt-get install -y insync
sudo apt-get install -y scudcloud
sudo apt-get install -y hunspell-en-ussudo
sudo apt-get install -y xscreensaver-screensaver-webcollage
sudo apt-get install -y xscreensaver-screensaver-bsod
sudo apt-get install -y xscreensaver-screensaver-dizzy
sudo apt-get install -y xscreensaver-gl
sudo apt-get install -y xscreensaver-gl-extra
echo " "
echo "Downloading .deb files."
read -p "Press ENTER to continue..."
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
wget http://download.teamviewer.com/download/teamviewer_i386.deb
echo " "
echo "Now installing the .deb files we downloaded earlier."
read -p "Press ENTER to continue..."
sudo gdebi google-chrome-stable_current_amd64.deb
sudo gdebi teamviewer_i386.deb
echo " "
echo "Now configuring mono."
read -p "Press ENTER to continue..."
mozroots --import --ask-remove
echo " "
echo "Now cleaning up the mess we made."
read -p "Press ENTER to continue..."
echo " "
sudo apt-get autoremove -y && sudo apt-get clean
echo " "
echo "Now we'll download kernel 4.0. ABORT if you are uncertain that you want this!"
read -p "Press ENTER to continue..."
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc1-vivid/linux-headers-4.0.0-040000rc1_4.0.0-040000rc1.201502222235_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc1-vivid/linux-headers-4.0.0-040000rc1-generic_4.0.0-040000rc1.201502222235_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc1-vivid/linux-image-4.0.0-040000rc1-generic_4.0.0-040000rc1.201502222235_amd64.deb
echo " "
echo "Now installing kernel 4.0. LAST CHANCE TO ABORT!"
read -p "Press ENTER to continue..."
sudo dpkg -i linux-headers-4.0*.deb linux-image-4.0*.deb
echo " "
echo "Now cleaning up our mess again."
read -p "Press ENTER to continue..."
rm *.deb
sudo reboot