在 18.10,我按照其文档安装 Docker CE。但我还没有成功完成。
~$ sudo apt install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
docker-ce is already the newest version (5:18.09.2~3-0~ubuntu-cosmic).
The following packages were automatically installed and are no longer required:
ca-certificates-mono cli-common dkms docbook-xml golang-docker-credential-helpers kdepim-runtime kio-ldap kio-sieve libboost-system1.65.1 libboost-thread1.65.1 libbsd0:i386 libc6-armhf-cross
libc6-dev-armhf-cross libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libestr0 libexpat1:i386 libfastjson4 libffi6:i386 libgdiplus
libgif7 libgl1:i386 libgl1-mesa-dri:i386 libglade2-0 libglade2.0-cil libglapi-mesa:i386 libglib2.0-cil libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libgtk2.0-cil libkf5akonadiagentbase5
libkf5akonadicalendar-data libkf5akonadicalendar5abi2 libkf5akonadinotes-data libkf5akonadinotes5 libkf5akonadisearch-bin libkf5akonadisearch-data libkf5akonadisearch-plugins libkf5akonadisearchcore5
libkf5akonadisearchdebug5 libkf5akonadisearchxapian5 libkf5alarmcalendar-data libkf5alarmcalendar5abi1 libkf5calendarutils-bin libkf5calendarutils-data libkf5calendarutils5abi1 libkf5dnssd-data
libkf5dnssd5 libkf5holidays-data libkf5holidays5 libkf5kdelibs4support-data libkf5kdelibs4support5 libkf5kdelibs4support5-bin libkf5kontactinterface-data libkf5kontactinterface5 libkf5notifyconfig-data
libkf5notifyconfig5 libkf5runner5 libkolabxml1v5 libkpimgapi-data libkpimgapicalendar5 libkpimgapicontacts5 libkpimgapicore5 libkpimgapitasks5 libkpimkdav-data libkpimkdav5 libllvm7:i386
libmono-cairo4.0-cil libmono-corlib4.5-cil libmono-i18n-west4.0-cil libmono-i18n4.0-cil libmono-posix4.0-cil libmono-security4.0-cil libmono-system-configuration4.0-cil libmono-system-drawing4.0-cil
libmono-system-security4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil libnvidia-common-390 libnvidia-compute-390:i386 libnvidia-decode-390:i386 libnvidia-encode-390:i386 libnvidia-fbc1-390:i386
libnvidia-gl-390:i386 libnvidia-ifr1-390:i386 libpciaccess0:i386 libqt5webengine5 libqt5xmlpatterns5 librarian0 libsensors4:i386 libstdc++6:i386 libtie-ixhash-perl libunique-1.0-0 libwayland-client0:i386
libwayland-server0:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386
libxdmcp6:i386 libxerces-c3.2 libxext6:i386 libxfce4ui-1-0 libxfce4ui-common libxfce4util-bin libxfce4util-common libxfce4util7 libxfconf-0-3 libxfixes3:i386 libxml-xpathengine-perl libxnvctrl0
libxshmfence1:i386 libxxf86vm1:i386 linux-libc-dev-armhf-cross mono-4.0-gac mono-gac mono-runtime mono-runtime-common mono-runtime-sgen nvidia-prime nvidia-settings python3-dockerpycreds
python3-websocket qml-module-org-kde-runnermodel rarian-compat screen-resolution-extra xfconf
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 49 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up docker-ce (5:18.09.2~3-0~ubuntu-cosmic) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2019-02-23 17:34:38 CST; 4ms ago
Docs: https://docs.docker.com
Process: 15398 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 15398 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
有人有成功安装 Docker 的经验吗?
谢谢!
答案1
我做了同样的事情,没有出现任何问题,这意味着你一定缺少了某个步骤。尝试执行对我有用的下一组步骤:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu
sudo apt-mark hold docker-ce
sudo apt-mark hold docker-ce
使用此命令检查 Docker 包和 Docker cli 是否已安装:
dpkg -l | grep -i docker
预期输出:
ii docker-ce 5:19.03.6~3-0~ubuntu-xenial amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:19.03.6~3-0~ubuntu-xenial amd64 Docker CLI: the open-source application container engine
最后检查版本:
docker version