Running ./blender/build_files/build_environment/install_deps.sh b/build_files on Ubuntu 20.04.3 LTS produces the following result (abbreviated):
If you're using CMake add this to your configuration flags: -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.8
Actually running the suggested make command results in an error:
Configuring Blender in "/home/dev/blender-git/build_linux" ... CMake Error at CMakeLists.txt:910 (message): At least Python 3.9 is required to build, but found Python 3.8
On Ubuntu the default python3-dev package is currently version 3.8.2 while the package python3.9-dev is also installed but not used:
$ apt list --installed | egrep "python.*dev" WARNING: apt does not have a stable CLI interface. Use with caution in scripts. libpython3-dev/focal,now 3.8.2-0ubuntu2 amd64 [installed,automatic] libpython3.8-dev/focal-updates,focal-security,now 3.8.10-0ubuntu1~20.04.2 amd64 [installed,automatic] libpython3.9-dev/focal-updates,focal-security,now 3.9.5-3ubuntu0~20.04.1 amd64 [installed,automatic] python3-dev/focal,now 3.8.2-0ubuntu2 amd64 [installed] python3.8-dev/focal-updates,focal-security,now 3.8.10-0ubuntu1~20.04.2 amd64 [installed,automatic] python3.9-dev/focal-updates,focal-security,now 3.9.5-3ubuntu0~20.04.1 amd64 [installed]
This diff specifies the exact Python version which is included in the package name thereby allowing install_deps.sh to suggest "-D PYTHON_VERSION=3.9" correctly.