Ubuntu – Ripping Audio CDs to FLAC and MP3 with abcde


I have an aging laptop that with Ubuntu 12.04 (Lucid) installed that I wanted to use to rip my CD collection to FLAC and MP3.

I didn’t want to have to use a GUI and I wanted the process to be as automated as possible – so I settled on the command line tool abcde (A Better CD Encoder).

First I installed all of the software required:

sudo apt-get install abcde cd-discid lame cdparanoia id3 id3v2

Then I made a backup of the abcde configuration file:

cp /etc/abcde.conf /home/myusername

I then copied and pasted a great abcde.conf file that I found online to /etc/abcde.conf:

sudo nano /etc/abcde.conf

This is the abcde.conf that I used:

# -----------------$HOME/.abcde.conf----------------- #
# A sample configuration file to convert music cds to 
#       MP3 format using abcde version
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for MP3. In this case
# the alternatives are gogo, bladeenc, l3enc, xingmp3enc, mp3enc.

# Specify the path to the selected encoder. In most cases the encoder
# should be in your $PATH as I illustrate below, otherwise you will 
# need to specify the full path. For example: /usr/bin/lame

# Specify your required encoding options here. Multiple options can
# be selected as '--preset standard --another-option' etc.
LAMEOPTS='--preset extreme' 

# Output type for MP3.

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.

# Give the location of the ripping program and pass any extra options:

# Give the location of the CD identification program:       

# Give the base location here for the encoded music files.

# Decide here how you want the tracks labelled for a standard 'single-artist',
# multi-track encode and also for a multi-track, 'various-artist' encode:

# Decide here how you want the tracks labelled for a standard 'single-artist',
# single-track encode and also for a single-track 'various-artist' encode.
# (Create a single-track encode with 'abcde -1' from the commandline.)

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
  echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\]

# What extra options?
MAXPROCS=2                              # Run a few encoders simultaneously
PADTRACKS=y                             # Makes tracks 01 02 not 1 2
EXTRAVERBOSE=y                          # Useful for debugging
EJECTCD=y                               # Please eject cd when finished :-)

I found that this configuration work very well for me and I especially liked that it put my FLAC and MP3 files into different folders.

The only issue that I had was that abcde would ask me if I wanted to edit metadata for the CD that I was ripping, requiring user input to continue.

Fortunately I found a setting in my backed-up abcde.conf that lets abcde run in non-interactive mode:

# Define if you want abcde to be non-interactive.
# Keep in mind that there is no way to deactivate it right now in the command
# line, so setting this option makes abcde to be always non-interactive.

So, I simply added the following line to my abcde.conf and then I was set:


All I have to do now is simply put a CD in the CD-ROM drive and then open a terminal and type:


Then when the CD ejects I simply put in the next CD, press the up arrow to bring up the last terminal command (abcde), and then press the Enter key to start the process over again.

Other than that I shared my music folder so that I can copy the FLAC and MP3 files to my desktop for backup.

All in all a great way to back up my CD collection with minimal fuss and interaction!


I did a clean install of Ubuntu 14.04 and there was an issue finding my cdrom drive. I successfully mounted the drive as follows:

sudo mkdir -p /mnt/cdrom
sudo mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom

After that I was able to run abcde as follows:

abcde -d /dev/sr0

Sources: Ubuntu Forum

4 thoughts on “Ubuntu – Ripping Audio CDs to FLAC and MP3 with abcde

  1. From the documentation of abcde it seems that you can also launch it in non-interactive mode by passing it the option -N:
    abcde -N

    Kudos for a great article!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s