在 Unbutu16.04 中升级 docker

Upgrade docker in Unbutu16.04

我在 Ubuntu16.05 中有 docker 版本 18.09.5。

Client:
 Version:           18.09.5
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        e8ff056
 Built:             Thu May  9 23:18:36 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.5
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       e8ff056
  Built:            Thu May  9 22:53:57 2019
  OS/Arch:          linux/amd64
  Experimental:     false

我需要安装nvidia-docker2,报错是

The following packages have unmet dependencies:
 nvidia-docker2 : Depends: docker-ce (= 5:18.09.7~3-0~ubuntu-xenial) but it is not installable or
                           docker-ee (= 5:18.09.7~3-0~ubuntu-xenial) but it is not installable
E: Unable to correct problems, you have held broken packages.

所以需要升级到18.09.7.

我跟着更新了。但看起来,它做的不对。 所以我中止了。

sudo aptitude install lxc-docker
The following NEW packages will be installed:
  aufs-tools{a} lxc-docker lxc-docker-1.9.1{ab} 
0 packages upgraded, 3 newly installed, 0 to remove and 11 not upgraded.
Need to get 8,590 kB of archives. After unpacking 30.6 MB will be used.
The following packages have unmet dependencies:
 lxc-docker-1.9.1 : Conflicts: docker.io but 18.09.5-0ubuntu1~16.04.2 is installed and it is kept back.
The following actions will resolve these dependencies:

     Remove the following packages:
1)     docker.io                   



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     lxc-docker [Not Installed]                         
2)     lxc-docker-1.9.1 [Not Installed]                   



Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.

所以对于我的情况,安装 nvidia-docker2 的正确方法是什么?

是否需要升级docker或者如何升级?

问题已解决。 关注了这个 link.

诀窍是我们可以使用

查看多个存储库
apt-cache madison docker-ce

然后选择18.09.7版本安装

现在 nvidia-docker-2 已安装。