How to install multiple PPAs and applications at once?

I'm going to set up a couple of general use computers on one of my lab's work benches.

There's a whole bunch of PPA repositories and applications from the Ubuntu repositories that I'd like to install after an initial Ubuntu installation.

Is it possible to write up a script that will install all those apps and PPAs in one go, requiring me only to double click the executable script and type in the admin password?

I imagine it would be fairly straight forward. Could someone point me to a quick tutorial or perhaps even provide a template script of some sort so I can add in the PPA names and apt-get install packages?

Thanks.


Solution 1:

I used the simple script below to add the texworks and Ubuntu GIS PPAs and then install texworks and Quantum Gis from their respective source, you can expand on it by adding the other PPAs and adding the package names to the apt-get install command line.

#!/bin/bash

echo "Adding PPAs"

add-apt-repository ppa:texworks
add-apt-repository ppa:ubuntugis/ubuntugis-unstable


echo "updating repositories"
apt-get update

echo "Installing packages"

apt-get install texworks qgis

echo "Finished adding PPAs and insatlling applications"
exit 0

Solution 2:

A bash script would do what you ask very easily.

Here is a link to a good bash scripting guide that I use: http://tldp.org/LDP/abs/html/

To put it simply, you need to call 3 commands to install from a PPA

  1. sudo add-apt-repository ppa:
  2. sudo apt-get update
  3. sudo apt-get dist-upgrade

If you want to jump right into an example of one, I have written up a blog article of one such automated bash script to install apps from different sources:

http://gautham-chandra.tumblr.com/post/15544311989/ninite-like-bash-script-to-install-and-configure-some

In the script, I ask for root permissions for the script ahead of time so that the commands doesnt have to be run with sudo in front of it as you asked.

A specific example from installing from a PPA is shown in the article when installing a different version of libnotify.