前提

1容器 用debian bookworm 建立
2设置容器代理见之前随笔

1:再宿主中建立 sources.list 文件 将bookwrom的软件源放入该文件

2:执行 docker ps -a 得到要设置的容器id
3:执行docker cp sources.list 容器id:/etc/apt/ 将软件源list放入docker容器中

3:容器中执行 apt update 成功后即可正常使用

清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware

posted on 2024-05-29 11:09  keleman  阅读(25)  评论(0编辑  收藏  举报