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.
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.
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
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.
Unattended installation from a list
For an unattended installation of a list of packages and adding several ppa to our system we may use the following script:
The script has two arguments. The first is a file (e.g.
mysources
) in the script directory where we saved a list of our software sources according to specifications for a sources.list e.g.:Replace all variables by the desired values
The second argument is a file (e.g.
packages
) with a list of packages we wish to install in the format e.g.:Save the script with e.g the name
uptodate
, make it executable and run from a terminal:What does the the script do?
It just copies our
mysources
list to/etc/sources.list.d/mysources.list
, updates package information and installs all packages from thepackages
list we provided by using xargs.Note: we may also have to download a valid key from launchpad keyserver to be able to install from the ppa we added.
Replace the signing key (here 72D340A3) by the appropriate one
Note 2: It is a good idea to run the script in a terminal and not by a double-click because we do want to know about errors.