FreeBSD Linux Jail优化

Ubuntu调整 APT::Cache-Start

在完成 使用 ubuntu-base tgz 包部署Linux Jail Ubuntu 部署之后,在Linux Jail中的Ubuntu环境中执行 apt update ,出现如下报错:

在Ubuntu Linux Jail中执行 apt update 报错
...
Fetched 34.9 MB in 1min 8s (511 kB/s)
E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. Current value: 25165824. (man 5 apt.conf)
Reading package lists... Error!
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 librust-enumset-derive-dev (NewVersion2)
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_universe_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.

虽然Google AI提示可以通过 /etc/apt/apt.conf.d/99custom-cache 配置文件:

/etc/apt/apt.conf.d/99custom-cache 配置文件调整 APT::Cache-Limit
# 100MB, which is 100 * 1024 * 1024 = 104857600
APT::Cache-Limit "104857600";

没有解决,但是我看到 apt update报错E: Dynamic MMap ran out of room 提供的方法直接增大 APT::Cache-Start64MB ,也就是最终配置:

最终解决的配置 APT::Cache-Start 设置 64MB
# 100MB, which is 100 * 1024 * 1024 = 104857600
APT::Cache-Limit "104857600";

# 64MB
APT::Cache-Start "67108864";

则实践 apt update 成功

参考