----
Admin Note: Rahul is a long time friend of mine, and is a well known geek amongst his friends and colleagues. I'm happy to announce that he will be enriching this site from time-to-time as a guest editor/author. First up is a small tid-bit of a script that he wrote to ease up his life between installations and reinstallations of everyone's favourite OS: Ubuntu. Over to his post..
Have you ever had to reinstall your ubuntu installation, and then bear the pain of manually installing the applications you've come to love (i mean use :)) everyday? If yes, then cheer up buddy, because all you really need is some magic (read scripting), some typing and spend some time digging the package names of your favourite applications.
To get started, you'll need to type the package information in a configuration file. The format of the file is really simple
- Any line starting with a # is ignored
- Blank lines are ignored
- Any other line, the first word is taken as the package name you want to install
Next, download this script, and make it executable
-
chmod +x rapt-client-install-packages.sh
Run this script as root (or using sudo command)
-
sudo ./rapt-client-install-packages.sh configFile
In case you do not specify the configFile (e.g. package-names.lst), it will bug you to manually enter packages names :D.
What this script does is
- read package names from the file specified (or bug user for package names in case filename is not specified)
- install these packages
That's it. And if everything runs fine, you should have a system will all your beloved apps installed.
The below snippet from the sample configuration file would install the packages – hardinfo, gmountiso, devilspie and nautilus-open-terminal. The lines for sysinfo and istanbul would be ignored. In case you later wish to install these packages, all you need to do is uncomment the line, and run the script again :).
-
#sysinfo = UNIX/Linux system information
-
hardinfo = UNIX/Linux hardware information
-
gmountiso = a PyGTK GUI to mount your cd images
-
#istanbul = Desktop session recorder
-
devilspie = find windows and perform actions on them
-
nautilus-open-terminal = nautilus plugin for opening terminals in arbitrary local paths
Note:
- The script will fail in case the package cannot be found using the repositories enabled on your system.
- In case you use additional repositories, you must add these manually to your apt configuration file, and do
CODE:
-
sudo apt-get update
-
- The hard part is not the installation, but setting up the applications to your likings
----
If you liked this post, then you can Subscribe to my feed
Quote of the day: "You will be who you will be. We are our choices. And we can choose to lead humanity away from this... darkness." - Icarus/Helios











May 3rd, 2008 at 3:28 am
Q1. where are the apps installed from ?
Q2. how would you say install mp3 decoder ?
May 3rd, 2008 at 11:43 am
@vibhu: oops. gave you the wrong link. Had thought that Rahul (who had written this post) had also written about setting up a "local" repository. Basically the above script will install from whatever repositories are enabled (local or online). mp3 decoder installation should then be as simple as apt-get install w32codecs (or w64codecs if u r using amd64 version)
May 15th, 2008 at 11:04 pm
How do you deal with packages that require input from the user, such as NIS or LDAP or SAMBA, which often prompt you for usernames, port numbers, passwords, server addresses, etc. ?
May 26th, 2008 at 9:59 am
@steve: The script doesn't have a preseed kind of functionality. so if any input is required, you will have to enter it while the particular package is being installed before the script continues further.