VmwareのUbuntuにdockerをインストールしようとしていますが、うまくいきません。これらは私が経験するコマンドとエラーです。
Sudo apt-get update
Sudo apt-get install docker-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-engine
「uname -a」を試して、64ビットアーキテクチャを実行していることを確認してください。
Dockerでは、Ubuntuのバージョンに関係なく、64ビットのインストールが必要です。
https://docs.docker.com/engine/installation/linux/ubuntulinux/
コメントで述べたように、あなたはする必要があります
lsb_release -c
でディストリビューション名を見つけます/etc/apt/sources.list.d/docker.list
には次の内容が含まれている必要があります(他には何もありません):deb https://apt.dockerproject.org/repo ubuntu-VERSION-NAME main
私の場合(Ubuntu 14.04別名 'trusty')私はdeb https://apt.dockerproject.org/repo ubuntu-trusty main
を追加しました
apt-get updateに続いてapt-get install docker.ioを実行することで、この問題を修正しました
Ubuntu 16.04で「使用不可」などの他の問題がありました。これは私のマシンの問題を解決するためのbashスクリプトです。
#!/bin/bash
Sudo apt update
Sudo rm /var/lib/apt/lists/*
Sudo rm /var/cache/apt/*.bin
VERSION-NAME=$(lsb_release -c)
y=$(echo $VERSION-NAME | awk '{print $2}')
echo $y
cd /etc/apt/sources.list.d
touch docker_test.list
echo "deb https://apt.dockerproject.org/repo ubuntu-$y main" > docker_test.list
Sudo apt-get install linux-image-extra-$(uname -r)
Sudo apt-get update
Sudo apt-get install docker.io
当時Dockerをアンインストールしなければならなかったときに、別の問題がありました。これは私のマシンのbashスクリプト( source )です。
# For unistall in Ubuntu
Sudo apt-get purge docker.io
# This will erase all your container images
Sudo rm -rf /var/lib/docker
# This will erase all docker configs
Sudo rm -rf /etc/docker/
Sudo apt-get purge docker.io