Audacity is a free, open source application for recording and editing audio. For more information, see the Audacity project home page.
Audacity is not installed by default in Ubuntu. To start using Audacity, install the package audacity from the Universe software channel. For more information on installing packages, see InstallingSoftware.
Once installed, click Applications -> Sound & Video -> Audacity to start Audacity.
Audacity and PulseAudio
Ubuntu 8.04 and above install PulseAudio as the default sound server. You have to make sure they don't both grab the sound device at the same time.
Use the pulse device
For Ubuntu 9.04 and above, there is an "ALSA: pulse" device listed in Audacity's preferences dialog. Make sure it is selected. (If there is no "ALSA: pulse", try "ALSA: default".) Now audacity records and plays back via PulseAudio, and with this you can also use PulseAudio's features (such as e g recording monitoring streams).
In order to get the "ALSA: pulse" device as mentioned above, David Henningsson has built fixed packages; they can be installed by adding his PPA as described in https://edge.launchpad.net/~diwic/+archive.
If the above solution does not work for you, start audacity with this terminal command: "pasuspender -- audacity"
This will temporarily pause PulseAudio while running audacity (causing other applications to stop sound input/output).
XRuns are drop-outs and/or clicks in recording or playback that are caused by your computer doing other things than handling soundcard input/output buffers. In the Audacity layer you can try to increase the latency (edit -> preferences -> recording).
Locating libmp3lame.so When Exporting MP3 Files
By default, the library libmp3lame.so is not installed in Ubuntu. Use the table below to find the name of the package you have to install depending on your Ubuntu version. (For more information on installing packages, see InstallingSoftware.)
Dapper (6.06), Hardy (8.04): package liblame0 from the Multiverse software channel.
Intrepid (8.10), Jaunty (9.04), Karmic (9.10): package libmp3lame0 from the Multiverse software channel.
Lucid (10.04): package liblame0 from the Multiverse software channel. Please note that Lucid regains the liblame0 package name. This is just a virtual package provided by the real libmp3lame0 package.
You can verify Audacity finds the library going to: Edit -> Preferences... -> Libraries -> MP3 Export Library.
When Audacity asks you to locate libmp3lame.so, you will be able to locate it in /usr/lib and export MP3 files.