[Reposted: A really convenient post-installation script from http://nicolargo.github.com/ubuntupostinstall/]
Tired of using my do-to lists to get everything you need installed on your freshly installed Ubuntu systems? If you are doing several installations of Ubuntu 12.04 daily this script will be a big time-saver for you. With this Python script you will avoid wasting time to install and configure your Ubuntu 12.04 operating system. Just download this script, run it with your favorite configuration file (or create your own custom config file, host it on github.com for free) and … enjoy!
I tested it out this morning and it works terrifically! Give it a try!
The script can:
- Install Ubuntu repositories (deb repos, PPA, …)
- Install packages
- Configure dots files (.bashrc, .vimrc, …)
- Configure the user interface (support Unity and Gnome Shell)
- Run every command line
- Write and use your own custom configuration list (apps, PPAs, etc)
- Completely automatic, quiet, no prompts, very quick and easy
- Great for remote support and fleet deployment
- You can create multiple configuration files for several kinds of complex installations remotely (Server, SQL, Scripts within scripts, whatever you can imagine)
- No more hassle sharing/hosting costly pre-configured larger-sized image files for cloud installs/deployment
- Game/Application installations scripts for Debian/Ubuntu Linux
How to use this script?
Just download and run it with the following command lines:
wget https://raw.github.com/nicolargo/ubuntupostinstall/master/ubuntu-12.04-postinstall.py sudo chmod a+x ubuntu-12.04-postinstall.py sudo ./ubuntu-12.04-postinstall.py
By default, the script will download and use this configuration file. https://github.com/nicolargo/ubuntupostinstall/blob/master/ubuntu-12.04-unity-postinstall.cfg
Also, you can download the above script configuration file, edit the contents in text editor, and use it locally on your own system together with ubuntu-12.04-postinstall.py and here is how to run it:
Use another configurations file
Using the -c option, you can select an alternative configuration file.
For example, you can configure Ubuntu for Gnome Shell using:
sudo ./ubuntu-12.04-postinstall.py -c https://raw.github.com/nicolargo/ubuntupostinstall/master/ubuntu-12.04-gnomeshell-postinstall.cfg
If you want to use a local edited configuration file (adapted to yours needs):
sudo ./ubuntu-12.04-postinstall.py -c mycfg.cfg
Custom Express Post-Installation Bash Script for Ubuntu 12.04 LTS (Example)
If you have Ubuntu 12.04 freshly installed, and you have completely updated your system and rebooted your system:
sudo apt-get update && sudo apt-get upgrade sudo reboot
And if you have a broadband hardwired connection to the Internet (WiFi would take forever to download all the packages), you can use the following bash script file to install most of the ‘recommended’ packages you will need on your system that are found on this web site’s Ubuntu 12.04 to-do list guide.
Estimated Time of Installation: 30-45 minutes depending on your bandwidth.
Download Post-Installation Python Script for Ubuntu 12.04 LTS:
cd Desktop wget http://debianhelp.files.wordpress.com/2013/01/ubuntu-1204-post-install2-tar-gz.doc cp ubuntu-1204-post-install2-tar-gz.doc ubuntu-1204-post-install1-tar.gz tar -xvf ubuntu-1204-post-install1-tar.gz sudo chmod a+x ubuntu-12.04-postinstall.py
For 32-bit Ubuntu 12.04 LTS systems:
sudo ./ubuntu-12.04-postinstall.py -c mycfg32.cfg
For 64-bit Ubuntu 12.04 LTS systems:
sudo ./ubuntu-12.04-postinstall.py -c mycfg64.cfg
Important: Keep in mind that it is going to take a while to install everything. Make some coffee. Watch some TV and relax while it does most of the work on this do-to list. Try to avoid using your computer until is it completely done and tells you to restart your computer as to avoid data corruption and installation errors.
Special Note: You will still need to manually install your 3rd party proprietary drivers, software like Google Earth, and configuring your firewall settings.
Understanding how the configuration file works:
The configuration files is organized into sections, and each section can contain name-value pairs for configuration data.
preactions section
This is the first section of the configuration file.
A line starting with the action_ string (following by the action name) defines a action (command line) to be executed.
The action name will be displayed during the script execution.
The lines will be executed before all the others steps.
Example:
[preactions] action_dummy = dpkg -l > /tmp/pkg-before.txt
The dummy action will create a /tmp/pkg-before.txt with a listing of all the packages installed on your system.
repos section
In this section, user can install the repositories (deb repository or PPA).
- ppa_xxx = ppa:ppauser/ppaname > Add the ppa:ppauser/ppaname to the system
- pkg_xxx = pkglist > Add the package list (space separed) to the system
- url_xxx = http://reposurl > Add the repository URL to the system
- key_xxx = key > Add the repository key to the system
xxx define the name of the action and will be displayed during the script execution.
Example:
[repos] ppa_glances = ppa:arnaud-hartmann/glances-stable pkg_glances = glances
Install the Glances PPA on the system and install the glances software.
packages section
From this section, you can install all your softwares, gathered by function, needs…
If the item starts with remove_ then packets are uninstalled.
Example:
[packages] network = iftop ifstat dev = vim git
Install iftop, ifstat, vim and git. Display “Install network packages” and “Install dev packages” during the script execution.
Example:
[packages] remove_unuse = eclipse
Remove eclipse. Display “Remove unuse” during the script execution.
dotfiles section
This section is dedicated to the dot files (.bash, .vimrc…) installed in your home folder.
The script can install the following dot files from URL:
- bashrc: BASH main configuration file
- bashrc_prompt: BASH prompt configuration
- bashrc_aliases: BASH aliases
- vimrc: VIM main configuration file
- htoprc: HTOP main configuration file
Example:
[dotfiles] bashrc = https://raw.github.com/nicolargo/dotfiles/master/bashrc
Create the ~/.bashrc from the https://raw.github.com/nicolargo/dotfiles/master/bashrc
unity and gnome3 sections
Configure Unity or Gnome Shell:
- theme: Configure the GTK theme (name)
- icons: Configure the icons theme (name)
- cursors: Configure the cursors theme (name)
- conky: Conky main configuration file (URL)
For the themes, packages have to be installed in the repos or packages sections.
[gnome3] theme = Boomerang icons = Faenza cursors = DMZ-White conky = https://raw.github.com/nicolargo/ubuntupostinstall/master/conkyrc
Configure Gnome Shell with the Boomerang GTK theme, Faenza icons and DMZ-White cursors. Configure Conky with the https://raw.github.com/nicolargo/ubuntupostinstall/master/conkyrc configuration file.
You can NOT use both unity and gnome3 section in the same .cfg file.
postactions section
This is the last section of the configuration file.
A line starting with the action_ string (following by the action name) defines a action (command line) to be executed.
The action name will be displayed during the script execution.
The lines will be executed after all the others steps.
Example:
[postactions] action_dummy = dpkg -l > /tmp/pkg-after.txt
The dummy action will create a /tmp/pkg-before.txt with a listing of all the packages installed on your system after the script execution.
Where can you host your own configuration file for free?
Try: http://github.com/
- Contribute?
- Need a new function?
- Found a bug?
- Need Support?
Please fill an issue here: https://github.com/nicolargo/ubuntupostinstall/issues/new


