On Ubuntu/Debian, you can use ffmpeg (in the package of the same name) to extract the audio only from video files:
$ ffmpeg -i input.ogm -ab 128k -vn output.ogg
ffmpeg detects the input and output formats automatically, so you can also convert to an MP3 (for example) just by specifying an output filename of the appropriate extension.
When converting audio for listening while working out or while traveling, it's also useful to downmix stereo to mono so you can listen with just one earbud without missing anything:
$ ffmpeg -i input.ogm -ab 128k -ac 1 -vn output.ogg
Further reading: ffmpeg command-line tool documentation