1. 程式人生 > >ubuntu16.04 安裝docker 報錯unable to resolve host address

ubuntu16.04 安裝docker 報錯unable to resolve host address

在ubuntu16.04安裝docker的時候

設定apt倉庫地址的時候執行以下命令

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

直接報錯: 

unable to resolve host [主機名]

此時不是因為網上的一些什麼該host檔案啥的

而是國外映象不同,直接修改映象地址就可以了  修改命令為:

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

這時候用的是阿里雲的映象,接著就像網上說的那樣走就ojbk了