How do I make post-install scripts so when I reinstall ubuntu everything is as I want it?
Things I want to achive:
- Installing PPA
- installing my programs
- themes needs to be installed
- Settings needs to be changed (power management, short commands, startup applications, etc.)
- system reboots
Easiest way is to gather all the commands you need and put them in a text file and make the text file executable.
We start out with going command line and do this:
And you start putting in commands you want to be executed.
Start with enabling all repositories and refreshing the software list because the LiveCD is outdated:
Look up inside USC what already is there and check the package name. Examples with VLC and smplayer:
In the same way of adding software like this you can also remove packages with:
(just be careful to check dependencies first)
Those are either in USC or have a PPA so you can add these with either one of the 2. For instance I like the equinox themes and I can add them like this:
or the Faenza icon sets:
So you gather all the installation instructions that you want to add and put them in your script each on a new line. You can speed things up by removing duplicate entries:
sudo apt-get upgrade
does not need to be done with every PPA: you can do that after adding all the PPAs but(!) before you install the software from the PPA.Theoretically you can have 1 of these script files for all Ubuntu installations but you might need to tweak them for every system.
This is my newest attempt to creating a post install script:
What does this do?
After installing I just execute my post_install file and it will run for a long time but it will take care of everything I want (well I will be adding more and more things over time so it will get longer).
I probably can improve it by making compound statements of some of these lines