這篇文章主要介紹“Ubuntu無法安裝docker源怎么解決”,在日常操作中,相信很多人在Ubuntu無法安裝docker源怎么解決問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”Ubuntu無法安裝docker源怎么解決”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
創(chuàng)新互聯(lián)公司專注于企業(yè)網(wǎng)絡營銷推廣、網(wǎng)站重做改版、寧德網(wǎng)站定制設計、自適應品牌網(wǎng)站建設、HTML5建站、商城開發(fā)、集團公司官網(wǎng)建設、外貿(mào)網(wǎng)站建設、高端網(wǎng)站制作、響應式網(wǎng)頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為寧德等各大城市提供網(wǎng)站開發(fā)制作服務。
按照各大網(wǎng)站以及個人習慣我會使用下面這種方法添加docker源:
root@ubuntu:~# sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
然而使用上面這條命令給我?guī)砹藷o盡的煩惱,甚至我都懷疑我是不是一個合格的linux工程師了,使用了這條命令提示以下錯誤:
ign:1 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan inrelease err:2 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan release 404 not found [ip: 218.104.71.170 443] hit:3 http://cn.archive.ubuntu.com/ubuntu eoan inrelease hit:4 http://cn.archive.ubuntu.com/ubuntu eoan-updates inrelease hit:5 http://cn.archive.ubuntu.com/ubuntu eoan-backports inrelease hit:6 http://cn.archive.ubuntu.com/ubuntu eoan-security inrelease reading package lists... done e: the repository 'https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan release' does not have a release file. n: updating from such a repository can't be done securely, and is therefore disabled by default. n: see apt-secure(8) manpage for repository creation and user configuration details.
下面是apt源文件中的內(nèi)容:
deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
發(fā)現(xiàn)是沒有任何錯誤的,但是你會發(fā)現(xiàn)在使用apt更新時會出現(xiàn)各種各樣報錯,最終還是沒有你想要的docker-ce安裝包,還是無法安裝:
root@uduntu:~# apt-get update get:1 http://cn.archive.ubuntu.com/ubuntu eoan inrelease [255 kb] get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates inrelease [88.4 kb] hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports inrelease get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security inrelease [92.9 kb] ign:5 https://download.docker.com/linux/ubuntu eoan inrelease err:6 https://download.docker.com/linux/ubuntu eoan release 404 not found [ip: 13.225.103.32 443] reading package lists... done e: the repository 'https://download.docker.com/linux/ubuntu eoan release' does not have a release file. n: updating from such a repository can't be done securely, and is therefore disabled by default. n: see apt-secure(8) manpage for repository creation and user configuration details. root@uduntu:~# apt search docker-ce root@uduntu:~#
解決方法:
在sources.list添加下面這一條就可以:
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
更新apt源:
root@uduntu:~# apt-get update get:1 http://cn.archive.ubuntu.com/ubuntu eoan inrelease [255 kb] get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates inrelease [88.4 kb] hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports inrelease get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security inrelease [92.9 kb] get:5 https://download.docker.com/linux/ubuntu bionic inrelease [64.4 kb] get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 packages [9,594 b] fetched 511 kb in 11s (48.3 kb/s) reading package lists... done root@uduntu:~#
這樣就好了,不報錯了,再看看docker-ce這個安裝包有沒有:
root@uduntu:~# apt search docker-ce sorting... done full text search... done docker-ce/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed] docker: the open-source application container engine docker-ce-cli/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed,automatic] docker cli: the open-source application container engine root@uduntu:~
到此,關于“Ubuntu無法安裝docker源怎么解決”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續(xù)學習更多相關知識,請繼續(xù)關注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
文章題目:Ubuntu無法安裝docker源怎么解決
路徑分享:http://weahome.cn/article/ihjgds.html