Ubuntu 12.04 - Post-Installation Script for codecs, multimedia, ...



When you run a standard Ubuntu desktop installation, you most of the time need to add some additional tools, compression format handlers, multimedia codecs, multimedia tools and latest software updates.

If like me you end-up installing Ubuntu systems quite often, you may have to repeat all these post-installation steps on and on ... Here comes this page, which is more of a reminder than of a technical article.

You'll find below the post-installation script that I use for almost all the Ubuntu installation I'm handling. It adds some very generic extensions that are useful (or not) for most of the people.

Just take it as it is : my knot in a handkerchief and a base that you can use and adapt for your own purpose. Idea of this page has come from a friend ... thanks Alain  :-)

This post-installation script is based on a standard Ubuntu 12.04 LTS installation as in general I always prefer to install a LTS. It is using some PPA, but these PPA are known to be quite stable. In a way, I've considered that the benefit provided by these PPA is worth the unstability risk it involves.

Please note that before running this post-installation script, you are supposed to have finalised your language localisation.

1. Added features

1.1. Missing repositories & Packages

The following post-installation script will add some important missing packages to your Ubuntu 12.04 LTS :

  • package handling tools (gdebi, synaptics, ...)
  • some archive file format handlers (7zip, rar, ...)
  • java runtime
  • latest libreoffice (4.0+)
  • latest gimp (2.8+)
  • multimedia codecs
  • flash player
  • audio tools (including mp3 tools)
  • video editors
  • mkv tools
  • h264 encoder (handbrake)
  • skype
  • gitso (remote assistance)
  • android tools (adb, fastboot, mtp)
  • Nautilus Thumbnailers (LibreOffice, Apk, Nds, ...)

This script will also install Gnome Shell fallback to allow to use the Gnome Classic interface, similar to previous Gnome 2 interface.

1.2. Mozilla Global Extensions

The post-installation script will also install some very useful Firefox & Thunderbird extensions as global add-ons :

  • firefox : adblockplus, print2pdf & city/country info
  • thunderbird : adblockplus, lightning, google calendar & google contacts

1.3. Kernel Freeze

By experience, I realized that kernel updates, even on a Long Time Stable version, are the most dangerous ones, giving sometimes some nasty instability issues (network, wifi, graphic card, ...).

This post-installation script allows you to freeze the kernel version to the one provided by the original 12.04 LTS version.

2. Post-Installation Script

The script is separated in different sections, each section providing a set of functionalities.

If you don't need or don't want some of the packages, just remove corresponding section.

# gedit post-install
# chmod +x post-install


# -------------------------------------------------------
#  Ubuntu 12.04 LTS Post-installation script
#  Must be run as sudo
#  24/02/2013, V1.0 - Creation by N. Bernaerts
#  07/04/2013, V1.1 - Add kernel freeze feature
# -------------------------------------------------------

# --------------- Freeze kernel version ----------------
# this command 'pins' apt to keep the kernel to currently installed original version
# remove this section if you want to always update to latest kernel version
KERNEL_VERSION=`apt-cache policy linux-generic | grep Installed | sed 's/^.*: \(.*\)$/\1/g'`
touch /etc/apt/preferences
echo "Package: linux-generic linux-headers-generic linux-image-generic linux-restricted-modules-generic" | tee -a /etc/apt/preferences
echo "Pin: version $KERNEL_VERSION" | tee -a /etc/apt/preferences
echo "Pin-Priority: 1001" | tee -a /etc/apt/preferences
# ---------------------------------------------------

# --------------- Full System Update ----------------
apt-get update
apt-get -y upgrade
# ---------------------------------------------------

# ---------------- System Utilities -----------------
# preload (speedup systems with good RAM amount)
apt-get -y install preload
# package management tools
apt-get -y install ppa-purge synaptic gdebi git
# complementary filesystem clients
apt-get -y install cifs-utils autofs ntfs-3g ntfsprogs
# complementary compression format
apt-get -y install p7zip-full rar unrar
# complementary font
apt-get -y install ttf-droid
# laptop & disk tools
apt-get -y install smartmontools disktype
# ---------------------------------------------------

# --------------- misc Desktop Tools ----------------
# grisbi : home banking
apt-get -y install grisbi
# keepassx : electronic wallet
apt-get -y install keepassx
# geany : modern text editor
apt-get -y install geany
# ---------------------------------------------------

# ------------------- Java Runtime ------------------
apt-get -y install default-jre
# ---------------------------------------------------

# --------------- Latest Libre Office --------------
add-apt-repository -y ppa:libreoffice/ppa
apt-get update
apt-get -y dist-upgrade
apt-get -y install libreoffice-style-crystal libreoffice-style-galaxy libreoffice-style-oxygen libreoffice-style-tango
apt-get -y install libreoffice-pdfimport libreoffice-presentation-minimizer
# ---------------------------------------------------

# ------------------ Graphical Apps -----------------
# misc graphical apps
apt-get -y install exiv2 gcolor2 imagemagick hugin
# gimp 2.8
add-apt-repository -y ppa:otto-kesselgulasch/gimp
apt-get update
apt-get -y upgrade
apt-get -y install gimp gimp-plugin-registry
# resynthize plugin
apt-get -y install gimp-python gimp-resynthesizer
# ---------------------------------------------------

# ------------ Multimedia Codecs & Flash ------------
# declare medibuntu repository
wget --output-document=/etc/apt/sources.list.d/medibuntu.list$(lsb_release -cs).list
apt-get -y update
apt-get -y --quiet --allow-unauthenticated install medibuntu-keyring
apt-get -y update
apt-get --yes --force-yes install app-install-data-medibuntu
# medibuntu codecs & flash
apt-get --yes --force-yes install libavformat-extra-53 ubuntu-restricted-extras x264
apt-get --yes --force-yes install gstreamer0.10-ffmpeg
# CSS DVD decryption
sh /usr/share/doc/libdvdread4/
# ---------------------------------------------------

# ------------------- Audio Tools -------------------
# misc tools
apt-get -y install pavucontrol audacity soundconverter normalize-audio flac vorbisgain
# mp3 tools
apt-get -y install easymp3gain-gtk easytag id3v2 lame mp3gain
# ripping tools
apt-get -y install cdrdao cd-discid
# wxmp3gain & wxlame
add-apt-repository -y ppa:cfgnunes/ppa
apt-get update
apt-get -y install wxmp3gain wxlame
# ---------------------------------------------------

# ------------------- Video Tools -------------------
# misc tools
apt-get -y install libav-tools
# XBMC (latest stable)
add-apt-repository -y ppa:team-xbmc/ppa
apt-get update
apt-get -y install xbmc
# video editors
apt-get -y install avidemux openshot
# mkvtoolnix
echo "deb ./" | tee -a /etc/apt/sources.list.d/mkvtoolnix.list
wget -O - | apt-key add -
apt-get update
apt-get -y install mkvtoolnix-gui
# blender (used by openshot video editor)
add-apt-repository -y ppa:irie/blender
apt-get update
apt-get -y install blender
# handbrake
add-apt-repository -y ppa:stebbins/handbrake-snapshots
apt-get update
apt-get -y install handbrake-gtk
# ---------------------------------------------------

# ----------------- Internet Tools ------------------
# filezilla
apt-get -y install filezilla
# skype
gdebi --n skype-ubuntu-precise_4.1.0.20-1_i386.deb
# gitso (remote assistance)
gdebi --n gitso_0.6.2_all.deb
# ---------------------------------------------------

# ------------------ Android Tools ------------------
# android tools adb and fastboot
add-apt-repository -y ppa:nilarimogard/webupd8
apt-get update
apt-get -y install android-tools-adb android-tools-fastboot
apt-get -y install libqtgui4 libqt4-network libqt4-declarative
tar -xvf QtADB*.tar.gz
mv ./QtADB*/QtADB /usr/local/sbin/qtadb
chmod +x /usr/local/sbin/qtadb
rm -R QtADB*
# mtp-tools and go-mtpfs
add-apt-repository -y ppa:webupd8team/unstable
apt-get update
apt-get -y upgrade
apt-get -y install mtp-tools go-mtpfs
# ---------------------------------------------------

# ------------------ YAD dialog box -----------------
add-apt-repository -y ppa:webupd8team/y-ppa-manager
apt-get update
apt-get -y install yad
# ---------------------------------------------------

# --------------- Mozilla extensions ----------------
# retrieve Firefox and Thunderbird installation script
wget -O /usr/local/sbin/install-mozilla-addon
chmod +x /usr/local/sbin/install-mozilla-addon
# --------------- Firefox extensions ----------------
# AdBlockPlus
# Print 2 PDF
# Website City + Country Info
# ------------- Thunderbird extensions --------------
# AdBlockPlus
# Lightning
# Provider for Google Calendar
# Google Contact
# ---------------------------------------------------

# ------------------ Gnome Classic ------------------
# Add Gnome Shell fallback for Gnome 2 interface
apt-get -y install gnome-panel gnome-tweak-tool
# ---------------------------------------------------

# ------------------ Nautilus Thumbnailers ------------------
# LibreOffice documents
unzip -d /usr/local/sbin
chmod +x /usr/local/sbin/lo-thumbnailer
wget -O /usr/share/thumbnailers/lo.thumbnailer
# Android APK
wget -O /usr/local/sbin/apk-thumbnailer
chmod +x /usr/local/sbin/apk-thumbnailer
wget -O /usr/share/thumbnailers/apk.thumbnailer
# Nintendo DS ROM
apt-get install gnome-gba-thumbnailer

# ----------------- System Cleanup ------------------
apt-get -y autoremove
apt-get -y autoclean
# ---------------------------------------------------

3. Run the script

You are now ready to launch the post-installation script.

# sudo ./post-install

Script will run without any user interaction and will take some time ...

At the end, all the packages should be installed.

You just need to reboot your Ubuntu workstation to get it fully operational.


Hope it helps

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus