溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Ubuntu19無(wú)法安裝docker源的示例分析

發(fā)布時(shí)間:2021-06-16 17:29:29 來(lái)源:億速云 閱讀:202 作者:小新 欄目:服務(wù)器

這篇文章主要為大家展示了“Ubuntu19無(wú)法安裝docker源的示例分析”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Ubuntu19無(wú)法安裝docker源的示例分析”這篇文章吧。

按照各大網(wǎng)站以及個(gè)人習(xí)慣我會(huì)使用下面這種方法添加Docker源:

root@ubuntu:~# sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

然而使用上面這條命令給我?guī)?lái)了無(wú)盡的煩惱,甚至我都懷疑我是不是一個(gè)合格的linux工程師了,使用了這條命令提示以下錯(cuò)誤:

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)是沒(méi)有任何錯(cuò)誤的,但是你會(huì)發(fā)現(xiàn)在使用apt更新時(shí)會(huì)出現(xiàn)各種各樣報(bào)錯(cuò),最終還是沒(méi)有你想要的docker-ce安裝包,還是無(wú)法安裝:

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:~#

遇到這種問(wèn)題我也覺(jué)得很頭疼,在網(wǎng)上找了很多解決方法都是不行,有人都說(shuō)是網(wǎng)絡(luò)問(wèn)題無(wú)法使用外網(wǎng)的源碼庫(kù),我看到這個(gè)文章我都懵了,我還試過(guò)安裝網(wǎng)易、阿里以及科大的源都不能更好的解決問(wèn)題,其實(shí)這個(gè)很簡(jiǎn)單看一下阿里、科大和網(wǎng)易的他們的源碼庫(kù)是怎么往配置文件里面寫(xiě)的,然后比葫蘆畫(huà)瓢畫(huà)一個(gè)不就完了

解決方法:

在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:~#

這樣就好了,不報(bào)錯(cuò)了,再看看docker-ce這個(gè)安裝包有沒(méi)有:

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:~

以上是“Ubuntu19無(wú)法安裝docker源的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI