An apt update or apt full-upgrade inside an Ubuntu Jammy installation running under FreeBSD jail may abort with:
E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. Current value: 25165824. (man 5 apt.conf)
E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. Current value: 25165824. (man 5 apt.conf)
E: Error occurred while processing libsurgescript0.5.4.4 (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_universe_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.
The root cause is that APT’s internal memory-mapped cache cannot grow sufficiently because it starts too small. The jail environment often exposes71c1e7ed limited virtual memory or smaller page configurations, making the default 24 MB Cache-Start inadequate for the full Jammy package index.
erroneous attempts include raising APT::Cache-Limit or APT::Cache-Grow. Those settings affect the ceiling but do not change the initial alocation, so the error persists. The only necessary configuration is to lift APT::Cache-Start.
add a dedicated configuration file inside /etc/apt/apt.conf.d/:
echo 'APT::Cache-Start "67108864";' > /etc/apt/apt.conf.d/99cachelimit
This sets the initial cache to 64 MB. After the file is in place, run:
rm -rf /var/lib/apt/lists/*
apt update
The stale list data must be purged so that APT can rebuild everything with the enlarged cache. Subsequent apt upgrade or apt full-upgrade will succeed.
If Cache-Start needs to be36c6a4da higher,56ab9aa3 adjust the value accordingly; for example, 134217728 for 128 MB. The20ff06e9lio8r5 parameter accepts bytes and works for any Ubuntu version inside FreeBSD jail environments.