Check out my experiences in the Linux world. Stay tunned for updates/reviews!

Wednesday, November 24, 2010

My current "What to do after installing Ubuntu?" script

I am sure any Linux user with a minimum of experience has gone through a number of "What to do after installing distro X?" articles. In my case, I have learnt a lot from those, both in terms of understanding certain customization features available, as well as the software that most people prefer.

Inevitably, I think all of us get to a point where we know which of those customizations are interesting/useful to us and which ones we can just pass on. When a user settles down on a number of updates/changes that will remain more or less the same for a given distro, that's when automation of such customization task makes sense and comes in handy.

THE SCRIPT

WARNING: I created this script to make my life easier. Although I have not seen any during my testing, it may contain bugs, so use it at your own risk!

My goal was to put together a simple script that allowed me to easily get any new Ubuntu installation up to speed, installing the applications I like and removing those I don't really care about. Another concept I was interested in was to create a script that felt more like an application with a (somewhat) proper GUI interface. The idea was to create something that would not scare unexperienced users away.

The way I see it, the easiest and most convenient approach would be to create a launcher under Main menu > System > Administration, as shown below.

Click on image to enlarge

To achieve this, simply go to Main Menu > System > Preferences and open the Main Menu editor. Once the application is open, add a new item to the Administration menu, as shown below:

Click on image to enlarge

Once run, the script starts with a welcome message, indicating that admin privileges are required and that the list of applications to be installed/uninstalled should be modified before moving forward.

Click on image to enlarge

The script will first update sources, just to be sure all repositories and software available are taken into account.

Click on image to enlarge

The flow of the script completes the uninstallation tasks first, then proceeds to installation.

CHANGE WHAT TO INSTALL / UNINSTALL

In order to modify the script so it installs/uninstalls the applications that suit your needs, simply open the CustUbuntu.sh file and access the section displayed below:

You probably noticed there are two (array) variables, named Uninstall and Install. Each of them is assigned a number of package names to uninstall and install respectively. The ones in there right now are obviously my choices, so if you want to add yours, simply enter the correct package name and separate it with a blank space.

As a quick example for installation, say you want to add AMSN to the list of applications that should be installed. The resulting Install variable would then look like this:

Because apt-get will take care of all dependencies, you don't need to manually add them (unless you want to, of course).

The same logic would apply in the case of an uninstallation. Should you not want any of the packages listed to either be installed or uninstalled, simply remove them from the list.

INSTALLATION

...Of sorts, of course. Downloading the script and providing it with the correct privileges is all that is required. After that, we can enable a launcher from the main menu to ease things up a bit further.

This script is obviously a work in progress. I already have some ideas to enhance it, but since it has already saved me significant hassle (and typing!) when installing new Ubuntu instances, I thought I'd share it.

If you'd like to see some other features or have spotted a bug, please let me know. Alternatively, if you want to modify it so it suits your own wicked ends, please feel free to do so.

Removing the lower panel is as easy as right-clicking on it and clicking on the "delete this panel" option. In order to make the upper panel fully functional, you will need to right click on it and add the "Window list" item.

Other than that, simply choose the Radiance Theme and use the Faenza icon theme. The wallpaper you can download from HERE.

Chema, I need a script like this for Fedora. I switched over to Fedora this past weekend and it is a pain to install some of the apps (Already miss Ubuntu). I was a long time user of Ubuntu and did not want to change BUT the switch over to Unity in the upcoming release pushed me over the edge.

Fedora uses the very powerful yum package manager. While yum's syntax is slightly different to apt-get, it should be fairly simple to convert the script so it works with yum.

Open a terminal and type

yum --help

so you can be sure what the syntax for yum to update, install and remove packages. Once you know, simply replace apt-get lines with their corresponding yum commands.

Note that all I am saying here makes sense as long as you are using GNOME Fedora. If you are on KDE, changing the script will be more complicated, as you will need to convert all Zenity commands to KDialog format.

Anyways, give it a go and let me know how it went. If you can't make sense of it, let me know and I will try to create a similar script for Fedora myself.

Good Luck!

PD: If Unity is your problem, no need to move to Fedora. Give Linux Mint a try, they already confirmed they will not transition to Unity. Mint is almost identical to Ubuntu, maybe even easier to use, and my script will work on it out of the box!

Very bad/amateur script.Just a few things I noticed on fast review:- dirname $0 fails if script is in directory with spaces (like "/home/user/My Scripts")- "set the script path correctly" ??? - there is NO need to cd into that dir in your usage case, none at all!- testing if package is installed with "which" is VERY VERY bad (see dpkg(1) man)- hardcoding "/home/shred/..." is bad as well

There could be more but this script is not worth more of my time. Anyway, don't publish JUNK like this to others anymore, you're just embarrassing yourself and could damage other people's systems if they are naive enough to run it.