System preparation for Ubuntu 24.04 LTS

Install dependencies:

$ sudo apt update
$ sudo apt -y install \
    7zip \
    bison \
    flex \
    gcc-multilib \
    lib32z1 \
    libc6-i386 \
    unzip \
    zip

Prepare the system for the next step (python2, pip, virtualenv, etc):

$ sudo apt -y install \
    build-essential \
    checkinstall \
    libbz2-dev \
    libc6-dev \
    libffi-dev \
    libgdbm-dev \
    libncursesw5-dev \
    libsqlite3-dev \
    libssl-dev \
    tk-dev

Python 2.7 is no longer available on Ubuntu 24.04 LTS, so you will have to compile and install that yourself:

$ wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
$ tar -xvf Python-2.7.18.tgz
$ pushd Python-2.7.18
$ ./configure --enable-optimizations
$ make
$ sudo make install
$ popd
$ wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
$ sudo python2 get-pip.py
$ pip2 install virtualenv
$ sudo ln -s /usr/local/bin/python /usr/bin/python

Next, a dynamic linker fix:

$ for sobjs in /usr/lib/x86_64-linux-gnu/*so\.6; do
    sudo ln -s "$sobjs" "${sobjs%.6}.5"
done

Finally, create a virtualenv in the same folder as the ./build.sh script:

$ cd "$APHY_ROOT"
$ python2 -m virtualenv venv