本文共 1598 字,大约阅读时间需要 5 分钟。
interfaces方式
修改/etc/network/interfaces,配置DNS需要在该文件中加入dns-nameserver xx.xx.xx.xxdns-nameserver xxx.xxx.xx.xxdns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xx.xxx
•dns-nameserver: 指定一条DNS地址,如果需要指定多个DNS则需要使用添加多行。
•dns-nameservers: 指定多个DNS地址,用空格隔开。 需要重启电脑方可生效resolvconf方式
修改DNS则是通过修改/etc/resolvconf/resolv.conf.d/base,在文件中加入nameserver xxx.xxx.xx.xxxnameserver xx.xx.xx.xx
•nameserver: 指定DNS地址,当有多个DNS记录时每个DNS记录占一行。
sudo resolvconf -u #更新/etc/resolv.conf文件
在天朝用外国的网址总是经历重重磨难,这里将国外源换为国内源,参考
备份原来的源sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak1
更换源为阿里源
sudo gedit /etc/apt/sources.listdeb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universemultiverse
更新源
sudo apt-get update
这时候你会发现docker pull正常了~
转载地址:http://ffcci.baihongyu.com/