Debian 10 更换 aliyun apt-get 源

概要

将 Debian 10  的 apt-get 源更换为 aliyun,以提升国内环境 apt install 的速度。

正文

1、备份原 apt-get 源文件

root@15ee503df884:~# cd /etc/apt
root@15ee503df884:/etc/apt# cp sources.list sources.list.bak

2、清除原 apt 源文件内容

root@15ee503df884:/etc/apt# > sources.list

3、添加 aliyun apt-get 源

root@15ee503df884:~# cd /etc/apt
root@15ee503df884:/etc/apt# echo "deb http://mirrors.aliyun.com/debian  stable main contrib non-free" >> sources.list
root@15ee503df884:/etc/apt# echo "deb http://mirrors.aliyun.com/debian  stable-updates main contrib non-free" >> sources.list

结尾

root@15ee503df884:/etc/apt# cat sources.list
deb http://mirrors.aliyun.com/debian  stable main contrib non-free
deb http://mirrors.aliyun.com/debian  stable-updates main contrib non-free

root@15ee503df884:/etc/apt# apt-get update
Get:1 http://mirrors.aliyun.com/debian stable InRelease [121 kB]
Get:2 http://mirrors.aliyun.com/debian stable-updates InRelease [49.3 kB]
Get:3 http://mirrors.aliyun.com/debian stable/non-free amd64 Packages [87.7 kB]
Get:4 http://mirrors.aliyun.com/debian stable/main amd64 Packages [7905 kB]
Get:5 http://mirrors.aliyun.com/debian stable/contrib amd64 Packages [51.0 kB]
Get:6 http://mirrors.aliyun.com/debian stable-updates/main amd64 Packages [7380 B]
Fetched 8222 kB in 4s (2157 kB/s)                    
Reading package lists... Done

可以看到,文件内容已经更新,且 apt-get 的源已经切换到了 aliyun。完事收工!

You may also like...

发表评论

电子邮件地址不会被公开。 必填项已用*标注

%d 博主赞过: