16

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
8
  • Make sure you have installed the prerequisites for your Ubuntu version. Then, install Docker. – NIMISHAN Dec 15 '15 at 9:37
  • I already followed the steps in prerequisites sudo apt-get install linux-image-extra-$(uname -r) – praveen Dec 15 '15 at 9:43
  • 1
    Have you created /etc/apt/sources.list.d/docker.list and add the correct deb entries for your Ubuntu? – Tung Tran Dec 15 '15 at 10:26
  • Thanks, earlier it is unable to create the /etc/apt/sources.list.d/docker.list after trying & trying finally it got created and successfully installed the docker in my machine.... thanks again.......! – praveen Dec 15 '15 at 11:10
  • Actually I am having the same issue although .../docker.list is correct avi@guest-Inspiron-1464:~$ cat /etc/apt/sources.list.d/docker.list deb apt.dockerproject.org/repo ubuntu-trusty main avi@guest-Inspiron-1464:~$ apt-cache policy docker-engine N: Unable to locate package docker-engine – igx Dec 15 '15 at 14:05
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/

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

1
  • 2
    Look at docs.docker.com/engine/installation/linux/ubuntulinux where there are detailed instructions on setting up apt and related keys to get docker. I had it installed via docker.io (the package maintained by ubuntu) which left me with an unresolved docker-engine package trying to install nvidia-docker. I had to uninstall and purge docker.io before getting docker-engine installed. – Caz Aug 26 '16 at 14:05
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.