xmodmap (some hints) you can rebind keys for the whole window system. The following approach will deliver what you want, but with side effects :(
Try it out in a terminal window first:
Let the left
Alt key be the so called
Assign the key the Mode_switch key sym:
xmodmap -e 'keycode 64 = Mode_switch Meta_L Alt_L Meta_L'
(Normally: Make sure that Mode_switch is assigned to one of the mod1-5 modifier keys, but this is already the case in Ubuntu)
Modify the third row of the
xmodmap -e 'keycode 113 = Left NoSymbol Home'
xmodmap -e 'keycode 114 = Right NoSymbol End'
As is the changes are kept until you log out. If you wish to keep it permanently put the following into a file
keycode 64 = Mode_switch Meta_L Alt_L Meta_L
keycode 113 = Left NoSymbol Home
keycode 114 = Right NoSymbol End
However be warned that this overrides the normal function of your Alt key (accessing menu, Alt-Tab etc.) :(
I am not an expert in xmodmap & Co, though. Maybe someone else knows how to fix this. I really like Ubuntu and Linux in general, but this whole keyboard stuff is unnecessarily complicated and sorrowly broken :-<