any sugestions how to fix the ubuntu bug?
No idea, I'm afraid. I've never had this problem on Ubuntu (we've tested with 10.04 and 12.04).
A test I'd like to try is: compile and upload using command-line toolchain. how do I do this with a sketch made in the IDE?
The quick and dirty approach is to compile using the IDE, then go to the build folder (which you'll be able to find by setting build.verbose to true in your preferences file) and invoke dfu-util yourself on the resulting .bin.
If you want to use the full command line toolchain, you'll need to make your code valid C++. Typically this just means adding prototypes, some includes, as well as a call to init() and the standard main() (see the libmaple main.cpp.example file for how to do the init() and main() parts).
I can't see why it would make a difference, though.