debian12配置国内源

最近在用docker容器,但是许多docker镜像都是最简版,而且是Debian,连最基本的命令也没有,安装也很难安装,必须要配置国内源才行,因此记录下配置过程,以备查询。

进入配置目录

cd /etc/apt/sources.list.d

编辑源文件

vi debian.sources

配置源

#Types: deb
# http://snapshot.debian.org/archive/debian/20230814T000000Z
#URIs: http://deb.debian.org/debian
#Suites: bookworm bookworm-updates
#Components: main
#Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

#Types: deb
# http://snapshot.debian.org/archive/debian-security/20230814T000000Z
#URIs: http://deb.debian.org/debian-security
#Suites: bookworm-security
#Components: main
#Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://mirrors.ustc.edu.cn/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://mirrors.ustc.edu.cn/debian-security
Suites: bookworm-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

#Debian12版本之前的配置格式不一样,在此就不说了,可以自行查询
apt-get update/apt update

刷新后可以测试一下

apt install -y net-tools

你可能感兴趣的:(Linux,docker)