Making ringtones for your jailbroken iPhone in Ubuntu is easy using SoundConverter. I’m going to assuming your iPhone is already jailbroken and you know how to upload files to it (usually with openssh).
First thing to do is make sure the Universe repository is enabled by going to System->Administration->Software Sources and checking “Community-maintained Open Source software (universe)”.
Next we will install SoundConverter by going to Applications->Add/Remove…, typing soundconverter into the search box, and checking Sound Converter.
Hit “Apply Changes” and SoundConverter will be installed. Now run SoundConverter by going to Applications->Sound & Video->Sound Converter and drag and drop the music files you want to make into ringtones into SoundConverter.
We need to set the output type to be AAC so in SoundConverter go to Edit->Preferences and check AAC under the “Type of result” setting.
Close preferences and hit the Convert button. SoundConverter will make a copy of the file as an AAC with the extension m4a, usually in the same folder as your original file unless you’ve set another option in Preferences.
Now all that left is to rename the extension of the file to m4r, upload it to your iPhone in the /Library/Ringtones folder, and you’re all set!