Debian 10 更换 aliyun apt | 您所在的位置:网站首页 › debian国内源测速 › Debian 10 更换 aliyun apt |
概要 1、简介 将 Debian 10 的 apt-get 源更换为 aliyun,以提升国内环境 apt install 的速度。 2、版本信息 Debian 10 apt 1.8.2.1详细步骤 1、备份原 apt-get 源文件 root@15ee503df884:~# cd /etc/apt root@15ee503df884:/etc/apt# cp sources.list sources.list.bak2、清除原 apt 源文件内容 root@15ee503df884:/etc/apt# > sources.list3、添加 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注:这里使用 echo 的方式配置是因为有可能有些系统中并未默认带有 vi 工具(比如 docker 镜像中的 debian 基础镜像中就不带 vi 工具) 4、更新 apt 执行如下命令更新 apt 源 root@15ee503df884:/etc/apt# apt update验证总结 1、验证配置 执行 cat sources.list 查看文件内容,可以看到配置已经文件。再执行 apt update,如果输出内容中有包含 mirrors.aliyun.com,表示设置已经生效 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 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。完事收工! 附录 参考阿里云镜像站 https://developer.aliyun.com/mirror/debian阿里云 debian 镜像支持版本 http://mirrors.aliyun.com/debian/dists/ |
CopyRight 2018-2019 实验室设备网 版权所有 |