18

I'm trying to install docker on Ubuntu in vmware, unsuccessfully. These are the commands and errors I experience.

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
Arronical
  • 20,241
praveen
  • 373
  • 3
  • 4
  • 10

4 Answers4

13

Try 'uname -a' and make sure you're running a 64-bit architecture:

Docker requires a 64-bit installation regardless of your Ubuntu version.

https://docs.docker.com/engine/installation/linux/ubuntulinux/

Andre P.
  • 131
7

As mentioned in the comments, you have to

  1. find out your distribution name via lsb_release -c
  2. the file /etc/apt/sources.list.d/docker.list should have the following content (and nothing else): deb https://apt.dockerproject.org/repo ubuntu-VERSION-NAME main

In my case (Ubuntu 14.04 aka 'trusty') I added deb https://apt.dockerproject.org/repo ubuntu-trusty main

SCBuergel
  • 181
1

I fixed this issue by running apt-get update followed by apt-get install docker.io

0

I had other issues including "Unable" in Ubuntu 16.04. This is bash script to solve issues in my machine.

#!/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

I had different issue when I had to uninstall Docker at the time. This is bash script (source) for my machine.

# 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
Cloud Cho
  • 693