博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu16.04下Docker pull connection refused 解决办法
阅读量:4048 次
发布时间:2019-05-25

本文共 1598 字,大约阅读时间需要 5 分钟。

检查Ubuntu是否设置了DNS,确保解析正常

Ubuntu DNS配置方法

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文件

Ubuntu 更换国内源

在天朝用外国的网址总是经历重重磨难,这里将国外源换为国内源,参考

备份原来的源

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/

你可能感兴趣的文章
mysql:sql alter database修改数据库字符集
查看>>
mysql:sql truncate (清除表数据)
查看>>
yuv to rgb 转换失败呀。天呀。谁来帮帮我呀。
查看>>
yuv420 format
查看>>
yuv420 还原为RGB图像
查看>>
LED恒流驱动芯片
查看>>
驱动TFT要SDRAM做为显示缓存
查看>>
使用file查看可执行文件的平台性,x86 or arm ?
查看>>
qt5 everywhere 编译summary
查看>>
qt 创建异形窗体
查看>>
简单Linux C线程池
查看>>
内存池
查看>>
输入设备节点自动生成
查看>>
GNU hello代码分析
查看>>
Qt继电器控制板代码
查看>>
wpa_supplicant控制脚本
查看>>
gstreamer相关工具集合
查看>>
RS232 四入四出模块控制代码
查看>>
linux 驱动开发 头文件
查看>>
container_of()传入结构体中的成员,返回该结构体的首地址
查看>>