Skip to content

Speed up Ubuntu install ~3x: explicit packages instead of lamp-server^ - #41

Merged
jsokol merged 1 commit into
mainfrom
perf/ubuntu-explicit-packages
Sep 20, 2026
Merged

jsokol merged 1 commit into
mainfrom
perf/ubuntu-explicit-packages

Conversation

@jsokol

@jsokol jsokol commented Sep 20, 2026

Copy link
Copy Markdown
Member

Summary

lamp-server^ is a tasksel "task" metapackage: it depends on the same apache2/mysql-server packages the Debian branch of setup_ubuntu_debian() already installs explicitly, but also pulls in a broad set of packages beyond the actual LAMP stack (CGI/Perl libraries, etc.) that SimpleRisk has no use for — confirmed by inspecting an installed image: 211 packages including libcgi-fast-perl, libcgi-pm-perl, libhtml-template-perl, Python stdlib bits, etc. It also meant installing whatever PHP version Ubuntu's own archive defaults to for that release, then immediately overriding it with the pinned Sury version and swapping Apache's active PHP module (from #40's PHP-version-pinning fix) — extra work for a result the explicit-install path gets directly.

Now that Ubuntu already gets the same Sury PHP8 repo Debian uses, Ubuntu can just take the same explicit apache2/mysql-server/phpX.Y install path Debian already proves works, with no lamp-server^ special-casing and no module-swapping dance needed. Test Dockerfiles updated to pre-install the same explicit packages instead of lamp-server^, for the same reason (and because lamp-server^'s pre-bake was most of the Docker build-step time in CI).

Test plan

  • bash -n simplerisk-setup.sh — syntax check passes
  • Full local Docker run (install → verify → uninstall → verify) on all three supported Ubuntu versions:
    • 22.04: 28/28 install checks, 13/13 uninstall checks, PHP 8.5.10 active.
    • 24.04: 28/28, 13/13, PHP 8.5.10.
    • 26.04: 28/28, 13/13, PHP 8.5.10, confirmed no courier-mta regression from the earlier sensible-mda uninstall fix.
  • Measured timing improvement per OS, roughly 3x faster overall:
    Before After
    Docker image build ~9 min (22.04) ~27 sec
    Script install step ~14 min ~6.5–7 min
    Total per OS ~20–24 min ~7–8 min

lamp-server^ is a tasksel "task" metapackage: it depends on the same
apache2/mysql-server packages Debian already installs explicitly in
this same function, but also pulls in a broad set of packages beyond
the actual LAMP stack (CGI/Perl libraries, etc.) that SimpleRisk has no
use for. It also meant installing whatever PHP version Ubuntu's own
archive defaults to, then immediately overriding it with the pinned
Sury version and swapping Apache's active PHP module - extra work for
a result the explicit-install path gets directly.

Now that Ubuntu already gets the same Sury PHP8 repo Debian uses (added
in a recent commit), Ubuntu can just take the same explicit
apache2/mysql-server/phpX.Y install path Debian already proves works,
with no lamp-server^ special-casing and no module-swapping dance
needed. Test Dockerfiles updated to pre-install the same explicit
packages instead of lamp-server^ for the same reason.

Verified end-to-end (install -> verify -> uninstall -> verify) on all
three supported Ubuntu versions in Docker: 22.04, 24.04, and 26.04, all
28/28 install checks and 13/13 uninstall checks, correct PHP 8.5.10
active on all three. Total time per OS dropped roughly 3x (from
~20-24 minutes to ~7-8 minutes: Docker image build time dropped from
minutes to ~30 seconds since there's far less to pre-install, and the
script's own install step dropped from ~14 minutes to ~6.5-7 minutes
since apt-get dist-upgrade now has a much smaller package set to churn
through).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jsokol
jsokol enabled auto-merge (squash) September 20, 2026 03:20
@jsokol
jsokol merged commit 54b3341 into main Sep 20, 2026
6 checks passed
@jsokol
jsokol deleted the perf/ubuntu-explicit-packages branch September 20, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant