apt更改为国内源
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apt更改为国内源相关的知识,希望对你有一定的参考价值。
参考技术A 由于linux默认apt源为国外源,网速太慢,所以不建议使用默认apt源,建议使用过内源。备份原文件: sudo cp /etc/apt/sources.list /etc/apt/sources.list.buckup
编辑原文件: sudo gedit /etc/apt/sources.list
国内源可以换成清华的,文件里保存的具体内容可以访问链接https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/,根据Linux版本选择对应的文件内容,
如版本选择的是Ubuntu18.04 LTS,内容如下
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
Docker拉取的镜像源更改为国内的镜像源
原文:Docker拉取的镜像源更改为国内的镜像源
vim /etc/docker/daemon.json { "registry-mirrors": [ "https://kfwkfulq.mirror.aliyuncs.com", "https://2lqq34jg.mirror.aliyuncs.com", "https://pee6w651.mirror.aliyuncs.com", "https://registry.docker-cn.com", "http://hub-mirror.c.163.com" ], "dns": ["8.8.8.8","8.8.4.4"] }
#重启docker服务
systemctl restart docker
以上是关于apt更改为国内源的主要内容,如果未能解决你的问题,请参考以下文章