By chenyi, 3 January, 2024
Forums

在下载命令的时候,有时候会报错响应时间太久,这时候就要通过换源来解决问题。

配置步骤:

1、首先要先备份旧的源

# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2、设置新的镜像源

# vim /etc/apt/sources.list

3、将默认的的镜像源删除掉,添加国内的镜像源例如清华源,阿里源,中科大源等,在vim中删除文件中所有内容的指令是:1,$d

4、更新软件包列表并升级已安装的软件包

# apt-get update


deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

debian系统就要上传debian的源库,上传ubuntu的源库apt-get update就会出错