APE is an open-source, free lossless audio format, just like FLAC or WAV. APE is also known as Monkey's Audio. To convert it to either Ogg Vorbis or MP3, you will first need to install several packages:
apt-get install monkeys-audio vorbis-tools
The first package includes the mac tool, which is a command-line frontend to the APE decoder. vorbis-tools is the package required to encode to the free Ogg Vorbis audio format. I recommend this one over MP3, since it's completely free and usually all the players on Linux support it by default.
Next, we will use the mac tool to convert the APE file(s) to WAV. For a single file, use the following command:
mac audio_file.ape audio_file.wav -d
For several files, use:
for i in *.ape; do mac "$i" "$i.wav" -d; done
Now all the APE files will be converted into WAV, which can be easily converted to Ogg Vorbis or MP3 using the commands below.
Convert WAV to Vorbis using the following command:
oggenc -b 256 audio_file.wav
Which will convert audio_file.wav to Ogg Vorbis at a nominal bitrate of 256 kbps. To convert more than one file at a time, use wildcards, e.g.:
oggenc -b 256 *.wav
Still, for MP3 the lame utility is required, which is included in the debian-multimedia.org repositories for Debian and Medibuntu for Ubuntu. After adding those repositories to your /etc/apt/sources.list file and updated the package lists (apt-get update), install the lame package:
apt-get install lame
Now, to convert WAV to MP3, use:
lame -b 256 audio_file.wav
If you want to convert several WAV files at a time, use:
for i in *.wav; do lame -b 192 "$i"; done
Which will convert all the files with the .wav extension using a nominal bitrate of 192 kbps.
If you're having trouble splitting a larger APE file with a CUE file, read this tutorial I wrote in the past.