To use this snippet, use the functions defined in src/functions/apt_get_checkinstall.sh, src/functions/apt_get_update, and src/functions/apt_get_clean.sh:
The functions defined in src/functions/*.sh can be bundled into a single script. All of those functions use the source command to reference other scripts.
A full example for an install.sh script that installs chezmoi from GitHub releases is given in src/examples/example.install.chezmoi.sh: