How to fix Ubuntu No such file or directory: 'avifenc'

If you see an error message such as

No such file or directory: 'avifenc'

on Ubuntu or similar Linux distributions, you need to install the libavif-bin package. This package provides the avifenc tool.

To install it, run

sudo apt install libavif-bin