A third party source provides the ipod-convenience package needed to properly mount and unmount an iPhone or iPod Touch, and for gtkpod users, a newer gtkpod is required for the iPhone and iPod Touch.
Extra steps for versions pre-Ubuntu 8.04 LTS (Hardy Heron)
Add the main Ubuntu 7.10 (Gutsy Gibbon) repository:
Click System -> Administration -> Synaptic Package Manager.
Once Synaptic starts, click Settings -> Repositories -> Third Party Software.
Click Add... and use deb http://ppa.launchpad.net/ipod-touch/ubuntu gutsy main as the APT line. (this source should have a key file to avoid the prompt to install without authentication).
Before installing newer packages, make sure to first uninstall libgpod.
Install the ipod-convenience package, as well as either amarok or gtkpod (or both if you like). When asked, enter the IP address of your iPod Touch or iPhone that you selected earlier. When asked for a folder to mount your iPod Touch or iPhone, either leave the default of /media/ipod or another folder if you prefer - just remember to use that folder name for rest of this guide. The package will make the folder for you.
Plug in your iPod Touch or iPhone via USB. This is REQUIRED when you run the next steps for the first time, as the USB connection is used to generate a hash required by the iTunes Database (if this fails to generate properly, see the troubleshooting section below). An added benefit is this also makes sure that your device won't turn the wifi into low power mode, breaking the transfer connection.
When done, click Applications -> Accessories -> Terminal. To mount your device, run:
$ iphone-mount or $ ipod-touch-mount
When prompted, enter your iPhone or iPod Touch's root password - by default, dottie in firmware 1.0 and alpine in 1.1, 1.2, 1.3 and 1.4.
Unmount your device, by running:
$ iphone-umount or $ ipod-touch-umount