Building Audacity 2.4.2 on Ubuntu 20.04

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Mac OS X
GNU/Linux and Unix-like
Site Admin
Posts: 85207
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Building Audacity 2.4.2 on Ubuntu 20.04

Post by steve » Tue Jun 23, 2020 5:35 pm

These steps are specifically for building a release version of Audacity 2.4.2 (available now) on Ubuntu 20.04.
For simplicity, the steps are deliberately kept to a minimum without any additional options.


1) Repository sources (sources.list) must include source code sources.
2) For MP3 / FFmpeg support, "non-free" repositories may need to be enabled.
3) Root access is required for installation (usually via "sudo").
4) Cmake version 3.15 or later.
5) An Internet connection.

Required dependencies:
(The package names below are those used by Ubuntu 20.04 and may be different for other distributions.)

For Debian / Ubuntu based distributions, these packages may be installed from the
command line with:

Code: Select all

sudo apt install <package-name>
cmake >= 3.15
gcc >= 4.9

wxWidgets is also required, but see notes below to avoid problems.

To install all in one command:

Code: Select all

sudo apt install build-essential cmake gcc libgtk2.0-dev libasound2-dev python3-minimal libavformat-dev libjack-jackd2-dev


Audacity should be built with wxWidgets 3.1 from the Audacity repository. This version
includes some important backported bug fixes that are not yet available upstream.
wxGTK3 should NOT be used for Audacity 2.4.2

The simplest way to get the required version of wxWidgets is to build it at the same
time as building Audacity. This requires that git is installed.

Code: Select all

sudo apt install git

Getting the Audacity source code:

Audacity 2.4.2 source code is available from:

Building Audacity:

After extracting the downloaded source code, open a terminal window and navigate
to the root of the source folder (the folder that contains the '' file).

Code: Select all

cd <audacity source code>
----------- [Update] -----------

There is a bug in the Audacity 2.4.2 source code that causes Audacity to crash when the "Sliding Stretch" effect is applied to stereo tracks. Before building the Audacity source, this bug can be fixed by applying a patch.

Download this patch file: download/file.php?id=28792
To apply the patch, put the patch in the root of your source code folder, then apply the patch with:

Code: Select all

patch -p 1 < changepitch.patch
If you get an error saying that the "patch" command can't be found, you can install it with

Code: Select all

sudo apt install patch
Now we can continue to build Audacity.

----------- [End of Update] -----------

Code: Select all

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -Daudacity_use_wxwidgets=local -Daudacity_use_ffmpeg=loaded ..
Note: On a multi-core system, "make" can be made considerably quicker by adding the "-j" switch. For example, on a 4 core system:

Code: Select all

make -j4

Pre-installation test:

Create a local folder for Audacity's settings. This folder will be only used for testing and will not be installed.

Code: Select all

mkdir "bin/Release/Portable Settings"
Then launch Audacity:

Code: Select all

cd bin/Release/

Return to the build folder:

Code: Select all

cd ../..
Then install:

Code: Select all

sudo make install

Installing the manual:

Download the manual from:

From the directory containing the manual ZIP archive:

Code: Select all

sudo unzip -d /usr/local/share/audacity