ubuntu 14.04 更新docker

問題描述,我的ubuntu版本是14.04,最近想安裝harbor(私有鏡像庫),我的docker是1.6版,老古董了,是3年前裝的,就想升級一下

(注意:如果你的系統很長時間沒有更新了,更新docker這個操作,很可能花費較多時間,因爲我的版本很老了,更新時間很長,花了一個多小時,慎重)

步驟如下:

1、刪除Docker,分別執行如下命令

sudo apt-get purge docker.io
sudo rm -rf /etc/docker/
sudo apt-get autoremove

 

2、更新apt源

刪除sudo vi /etc/apt/sources.list中的地址,加上

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main

3、安裝Docker,分別執行下面三個命令

sudo apt-get update
sudo apt-get upgrade
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -

不知道什麼原因,執行第3行,我的報錯了,說連接不上

於是,我在網上又找了一個命令(下載的是1.13版本):

apt-get install docker-engine=1.13.0-0~ubuntu-xenial

最終成功了

參考文獻:https://www.jianshu.com/p/016571685952

https://blog.csdn.net/weixin_39758556/article/details/79376674

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章