Building Audacity 2.4.2 on Ubuntu 20.04

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.


Prerequisites:

  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:

sudo apt install <package-name>

build-essential
cmake >= 3.15
gcc >= 4.9
libgtk2.0-dev
libasound2-dev
python3-minimal
libavformat-dev
libjack-jackd2-dev

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

To install all in one command:

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

WxWidgets:

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.

sudo apt install git

Getting the Audacity source code:

Audacity 2.4.2 source code is available from:
https://www.fosshub.com/Audacity.html


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 ‘README.md’ file).

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: https://forum.audacityteam.org/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:

patch -p 1 < changepitch.patch

If you get an error saying that the “patch” command can’t be found, you can install it with

sudo apt install patch

Now we can continue to build Audacity.

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

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -Daudacity_use_wxwidgets=local -Daudacity_use_ffmpeg=loaded ..
make

Note: On a multi-core system, “make” can be made considerably quicker by adding the “-j” switch. For example, on a 4 core system:

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.

mkdir "bin/Release/Portable Settings"

Then launch Audacity:

cd bin/Release/
./audacity

Installation:
Return to the build folder:

cd ../..

Then install:

sudo make install

Installing the manual:

Download the manual from: https://www.fosshub.com/Audacity.html

From the directory containing the manual ZIP archive:

sudo unzip audacity-manual-2.4.2.zip -d /usr/local/share/audacity