跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

apt-bootstrap.sh

40 行 · 1.8 KB历史下载
1#!/bin/sh
2# Run as root before any dependency transaction. Keep the bootstrap independent
3# of python3/curl and of archive mirrors that may have triggered APT's retry bug.
4set -eu
5. /etc/os-release
6if [ "$ID" != debian ] || [ "${VERSION_ID:-}" != 13 ]; then
7 exit 0
8fi
9version=$(dpkg-query -W -f='${Version}' apt)
10if dpkg --compare-versions "$version" ge 3.0.4; then
11 exit 0
12fi
13printf 'Updating Debian APT %s to a version with the delayed-item memory fix...\n' "$version"
14stage=$(mktemp -d)
15trap 'rm -rf "$stage"' EXIT
16chmod 0755 "$stage"
17mkdir -m 0755 "$stage/lists"
18# HTTP also works in minimal images without a CA bundle. APT still requires the
19# Debian archive signature and package hashes; no insecure options are enabled.
20printf '%s\n' 'deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian-security trixie-security main' > "$stage/security.list"
21apt_bootstrap_get() {
22 env DEBIAN_FRONTEND=noninteractive apt-get \
23 -o Acquire::Retries=0 -o Acquire::http::Timeout=15 -o Acquire::https::Timeout=15 \
24 -o DPkg::Lock::Timeout=60 -o APT::Update::Error-Mode=any \
25 -o Dir::Etc::sourcelist="$stage/security.list" -o Dir::Etc::sourceparts=- \
26 -o Dir::State::lists="$stage/lists" "$@" </dev/null
27}
28apt_bootstrap_get update
29packages='apt libapt-pkg7.0'
30if [ "$(dpkg-query -W -f='${Status}' apt-utils 2>/dev/null || true)" = 'install ok installed' ]; then
31 packages="$packages apt-utils"
32fi
33# The package names above are fixed, and --only-upgrade preserves optional tools.
34apt_bootstrap_get install -y --only-upgrade --no-install-recommends $packages
35version=$(dpkg-query -W -f='${Version}' apt)
36if ! dpkg --compare-versions "$version" ge 3.0.4; then
37 printf 'APT is still %s; dependency installation stopped. Check the Debian security source and retry.\n' "$version" >&2
38 exit 1
39fi
40printf 'Debian APT %s is ready.\n' "$version"