跳转到内容
GitHub

配置 APT

把 Debian 或 Ubuntu 的 sources 指向 Depsilo 的 /apt/ 反向代理,同时保留签名校验。

之前https://deb.debian.org/debian
之后http://localhost:23333/apt/debian

Depsilo 是 APT 反向代理:替换 sources 文件中的仓库 URL,而不是设置 Acquire::http::Proxy。Depsilo 原样传递已签名的仓库内容,APT 仍会执行正常的 GPG 验证。

下面是 Debian 13 “trixie” 示例;其他版本必须替换 suite。

/etc/apt/sources.list.d/debian.sources
Types: deb
URIs: http://localhost:23333/apt/debian
Suites: trixie trixie-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: http://localhost:23333/apt/debian-security
Suites: trixie-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Ubuntu 使用 /apt/ubuntu 和对应的 codename:

/etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://localhost:23333/apt/ubuntu
Suites: noble noble-updates noble-security
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

先备份并人工编辑现有 sources;不要盲目运行跨发行版的 sed -i。

  1. 刷新索引

    终端窗口
    sudo apt update
  2. 确认来源已经改变

    终端窗口
    apt-cache policy | head
  3. 在 Admin 中确认流量

    在 Access logs 中核对 /apt/ 请求;InRelease 等签名元数据会按原样转发。