From 0215ed05f056364ad128b344169b6d3eb129aa1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Sat, 20 Dec 2025 23:49:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(apt-install):=20=E4=BF=AE=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=BE=9D=E8=B5=96=E7=9A=84=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devcontainer/apt-install-with-cache.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/devcontainer/apt-install-with-cache.sh b/devcontainer/apt-install-with-cache.sh index 0fc7808..5f4cf95 100644 --- a/devcontainer/apt-install-with-cache.sh +++ b/devcontainer/apt-install-with-cache.sh @@ -1,6 +1,6 @@ #!/bin/bash #------------------------------------------------------------------------------------------------------------- -# URL="https://git.1-h.cc/Scripts/Linux/raw/branch/2026/devcontainer/apt-install-with-cache.sh"; bash <(curl -fsSL "$URL") git vim curl +# curl -fsSL https://Git.1-H.CC/Scripts/Linux/raw/branch/2026/devcontainer/apt-install-with-cache.sh | sudo bash -s -- git vim curl #------------------------------------------------------------------------------------------------------------- # =================配置区域================= @@ -54,7 +54,8 @@ fi # -o Dir::Cache::archives="$CACHE_DIR" 告诉 apt 把包下载到我们指定的目录 # --download-only 告诉 apt 只下载依赖包,不要解压安装 echo "⬇️ 正在检查并下载依赖..." -$SUDO DEBIAN_FRONTEND=noninteractive apt-get install -y --download-only \ +export DEBIAN_FRONTEND=noninteractive +$SUDO apt-get install -y --download-only \ -o Dir::Cache::archives="$CACHE_DIR" \ $PACKAGES > "$LOG_FILE" 2>&1 @@ -81,7 +82,8 @@ echo "✅ 依赖下载/缓存完成。" # 再次运行 install,指向同一个缓存目录。 # apt 会检测到目录里已经有对应的 .deb 文件(且哈希值匹配),就会直接使用缓存,跳过下载。 echo "🚀 开始安装..." -$SUDO DEBIAN_FRONTEND=noninteractive apt-get install -y \ +export DEBIAN_FRONTEND=noninteractive +$SUDO apt-get install -y \ -o Dir::Cache::archives="$CACHE_DIR" \ $PACKAGES > "$LOG_FILE" 2>&1