Remove old Kernels from Ubuntu

If you are reading this you have probably been using Ubuntu for a while, updating it quite regularly. You mostly likely use GRUB ( to handle a dual boot, because on your computer you have a Dual Boot or simply you use GRUB to handle your start-up, because Ubuntu keeps old kernels and you never know if the newest one will crash your machine or work perfectly. That’s a nice feature because it brings you stability and choice, but after a while it may get useless and totally superfluous.

After a while, you can end up with many entries in your GRUB menu and you maybe dislike this situation. The solution is very simple. Here are the steps you have to follow in order to clean up you GRUB menu and remove your old kernels for your computer:

  1. Open a terminal and type uname -r. This will show you which kernel you are actually using. If you boot your system normally, like 99,9% of the users do, you will be using the newest kernel, let’s say  2.6.24-23-generic.
  2. OK, now you know that you need to keep 2.6.24-23-generic. As I mentioned above, is a good thing not to remove the last two kernels, expecially if the one you are using is very new (ex: you downloaded it today).
  3. Open Synaptic (System->Administrator-> Package Manager Synaptic). Use the search button and search for linux-image-2. This will show you all the package named linux-image-2* where * means “something”. Some of these packages will have a GREEN box at the beginning of the corresponding row, some will have a WHITE box. The green box tells you that the package on that row is installed in your system. I think you can guess alone what the white box means…
  4. Among all the installed packages, locate your current kernel, ex: 2.6.24-23-generic. This is the package you do not want to remove. As we said above, we want to keep another version. So, starting from the row of your actual kernel, go upwards and find the newest version which was installed before the actual one you are using. For example: 2.6.24-22-generic.
  5. Now you want to uninstall everything which is not 2.6.24-23-generic or 2.6.24-22-generic. So, locate all the other GREEN boxes, representing older kernels, click with the right button of your mouse on the corresponding line an select Mark for removal. The line will get very RED, telling you that it will be removed. Repeat this option for all the other old kernels you do not want to keep;
  6. Once you are done, simply click on the apply button. Synaptic will remove all the old kernels you do not need anymore, giving you some more free space on your disk and cleaning the GRUB menu. Yes, the GRUB menu should update automatically.

In case for some reason, after rebooting your system, the GRUB menu did not change, you can manually edit the configuration file. Open a terminal and type:

sudo gedit /boot/grub/menu.lst

scrolling down this file will show you your menu. It is quite intuitive so I do not explain how it looks like. Simply remove the rows referring to the OLD kernels, remembering not to remove the new ones. Once you are done, click on save and reboot your system.

This should clean up both your hard disk and your GRUB menu from old kernels you do not need anymore. Hope this helps.

Remove old Kernels from Ubuntu

Rainlendar on Ubuntu: everything fine except…

I’ve been using rainlendar for quite a while now. I really love it, I can easily manage all my schedule and remember staff that I would forget..

There is just a little problem in using Rainlendar with Ubuntu. Probably you would like your Rainlendar calender to start at the startup. In order to do this you probably did the following:

System->Options->Sessions->Add (Name: rainlendar, Command:rainlendar2, Comment: whatever you want)

this action is supposed to make Rainlendar start at the startup. It’s actually the right way, and it actually starts in the majority of cases. But in a non-trascurable number of cases, it doesn’t start properly. This mean that Rainlendar could not start at all or that it maybe starts but it’s interface is splitted over the whole desktop (there is typically a small number in the upper left corner of your Desktop).

This happens if Rainlendar starts before some important elements of the GNOME toolbar has been initialized.

An easy and powerful way to resolv this issue is quite obvious: delay the startup of Rainlendar.

Creating the script
As you maybe already know the Terminal is really, really powerful. For an advanced user it’s basilar to have a terminal to use, because it gives you the full (well, almost :D) control on your machine. As this tool is really useful, it also provides a nice function which can be used in our case: sleep. As the name states, this function make the script sleep (wait) for X seconds before going on executing the script content). So these are the steps to take:

  1. Open a terminal
  2. Move to the directory where you want to create the script (maybe you home directory it you just want to modify the behavior for your user, otherwise you can put it in /home). To move between your directories, the command to use is cd. For example: cd ~/Desktop will lead you to your user’s desktop as the tilde (~) stays for home directory;
  3. If you are in your home directory you don’t need any particular permission to move. If you on the other hand are in the /home directory you need to get the rights of administrator. In order to do this you can try sudo su. After this command you will be asked for your password. If you are among the sudoers (administrators) you should immediatly gain the administrator rights. If you are not among them, well… you can only act in your home directory;
  4. Create the script. Now type nano Nano is a small but very powerful command-line writing tool. This command will open the newly created file;
  5. Now fill in this file! As we discovered before we need to use the sleep command. So these are the rows you have to insert:#!/bin/sh
    sleep 10
  6. Now save the file. To do this type CTRL+O and then ENTER;
  7. We now have the file we need. Making this file start at the startup should solve our problem. But there is just another issue: we must make our file executable! To do this the command to use is chmod. I’ll probably tell you what I know about this command in another post some day. So far you just need to execute this command chmod 700
  8. The last thing to do is to make this script start at the startup. You should already have a rainlender2 entry in your startup list. To modify this (or to add a new one) go on System->Preferences->Session. Find the rainlendar2 entry and change the “Command” to /home/ or /home/USER/YOURDIR/ depending on where you decided to create your startup script. If you don’t have a rainlendar2 entry, click on the “Add” button and simply create a new entry (the important field is “Command”, the other two fields are just your your usage.

This should solve the issue. Hope this helps.

Now let’s go on with studies.

Rainlendar on Ubuntu: everything fine except…

Ubuntu: How to create a link to a directory on your Desktop

I remember it took me some time to understand how this worked… so I want to let you know how you can add a link to a generic directory on your Desktop. It’s really easy to do that, but it can be quite of tricky because it’s a different way from Window’s one.

In Ubuntu (assuming that you are using GNOME), there are many different ways to create your link:

  1. Nautilus. Simply navigate to the containter of the directory you want to link, right click on that directory and “Create Link”. This will place a link to your dir exactly where you are. Now take the link (cut: CTRL+X) and paste (CTRL+V) it on the desktop;
  2. Mouse. Drag the folder to the Desktop using the middle mouse button. A small window will open: select “Link here”;
  3. Terminal. ln -s /path/directory ~/Desktop/Name
  4. Right click on the Desktop and choose “create launcher”. In the “command” field write “nautilus /path/directory” without the quotes.

A short (and hope useful for somebody) post today! 🙂

Ubuntu: How to create a link to a directory on your Desktop

OpenOffice: Working with formulas

As I am studying telecommunication engineering and I like to work with my computer, I use quite a lot OpenOffice to write pages of formulas for my projects, essays and so on. Working with formulas in OpenOffice is not difficult at all. What I want to do today is to give you some basic advice on how to work with formulas in an easy and quick way.

Supporting Formulas

First of all you have to make sure that your OpenOffice has the support for formulas. It can happen that you didn’t install it when you installed OpenOffice… some years ago maybe. It’s simply to understand if your OpenOffice can work with formulas or not. Simply go on Insert -> Objects -> Formula. If you are able to do this then everything is fine. Otherwise, if you are not able to select the “Formula” option then you have to install something.

If you are under Linux then you have to install the package “”. If you use Ubuntu you can do this in two ways:

  • By using Synaptic package manager (System->Administration->Package Manager Synaptic;
  • By using a simple terminal (Programs->Accessories->Terminal)

I’ll explain you how to do this in the second way. Open a terminal and write

sudo apt-get install

and click ENTER. You should see something like this:

now insert your password. Sudo is the command you have to use in order to (try..) to gain administrator rights on your machine. If your account (username) is among the sudoers (administrators), you will be able to install whatever you want, otherwise you will be blocked and you have to ask an administrator to install things for you.

You have of course to be connected to Internet in order to permit Ubuntu to go on a repository and pick up your package. After that the package should be installed. Close and open OpenOffice again and try to go on Insert->Object->Formula. Wow, it functions!

The formula syntax

Of course there is a syntax you have to use in order to correctly insert your formulas. The best way of quickly understand how this syntax works is try, try and try. OpenOffice will show some ? when you write something it doesn’t really like. I suggest you to have a look on this PDF File:

This is the official Formula Reference by OpenOffice. It contains all the symbols and stuff you can insert in your formulas.

Quick tips

Here are some quick trick you may need to know:

  • If you need invisible parenthesis use this ones: {};
  • To create a division bar write over. For example {3+x} over {e^x};
  • To insert a letter of the Greek alphabet write %nameofletter. For example %alpha, %omega, %BETA. Case matters here!;
  • For writing something just over or under something (apex position: powers and so on) try a^2, or a_2, or a^1_2;
  • If you use lots of formulas it’s boring to always go on Insert->Object->Formula. Select one formula and copy it (select the object formula, not its text). Then paste it and modify it whenever you need a new formula.

That’s it. You can have a look on this file, which is a ODT doc (OpenOffice written document) which contains some basic test I did with OpenOffice Formula: formulatest.odt

OpenOffice: Working with formulas