8

Despite trying both the official installation mechanism using the new apt repo described here, as well as the curl -fsSL https://get.docker.com/ | sh route, I still get E: Unable to locate package docker-engine from APT when I try to apt-get install docker-engine.

My versions are:

$ uname -a
Linux blah 4.5.5-x86_64-linode69 #3 SMP Fri May 20 15:25:13 EDT 2016 x86_64 GNU/Linux


$ lsb_release -c
Codename:       jessie

$ cat /etc/debian_version
8.5

$ cat /etc/apt/sources.list
deb http://ftp.uk.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ stable main
deb http://security.debian.org/ stable/updates main
deb-src http://security.debian.org/ stable/updates main
deb http://http.debian.net/debian wheezy-backports main

The only file in my /etc/apt/sources.list.d is docker.list which contains:

deb https://apt.dockerproject.org/repo debian-jessie main

apt-cache policy docker-engine doesn't find it either:

apt-cache policy docker-engine
N: Unable to locate package docker-engine

How might I resolve this?

Alex
  • 8,093
  • 6
  • 49
  • 79
  • did you already perform an apt-get update before? – lvthillo Aug 02 '16 at 20:14
  • Yep, and after. Several times too. – Alex Aug 02 '16 at 20:20
  • Are you using debian 8.0 jessie 64-bit? + if yes: what's the content of /etc/apt/sources.list.d/backports.list – lvthillo Aug 02 '16 at 20:25
  • backports.list doesn't exist at that location. How do I confirm which architecture version of debian I have installed? I suspect it could be 32bit from memory... – Alex Aug 03 '16 at 05:10
  • I see x86_64 as output of your uname -r so your using 64 bit which is fine and supported by docker. When you don't have that file you have to create it manually. Check the answer – lvthillo Aug 03 '16 at 05:45

4 Answers4

7

Edit your sources.list and change the following line from:

deb http://http.debian.net/debian wheezy-backports main

to

deb http://ftp.debian.org/debian jessie-backports main

Update and install docker:

apt-get update
apt-get install docker.io

Edit

To install a specific version of docker-engine download the .deb package from here, e,g the latest one is docker-engine_1.9.1-0~jessie_amd64.deb:

wget https://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.9.1-0~jessie_amd64.deb
sudo apt-get update
dpkg -i docker-engine_1.9.1-0~jessie_amd64.deb

Maybe you will get an error , to fix it run:

apt-get -f install
dpkg -i docker-engine_1.9.1-0~jessie_amd64.deb
itinance
  • 11,711
  • 7
  • 58
  • 98
GAD3R
  • 4,317
  • 1
  • 23
  • 34
  • This isn't the latest docker version. Why can't I install `docker-engine`? `docker.io` installed this way is at version 1.6.2, that's [_really_ old](https://github.com/docker/docker/blob/master/CHANGELOG.md#162-2015-05-13)! – Alex Aug 03 '16 at 13:14
  • 1
    I think we've found my problem: it claims incorrect architecture as the system is i386 but the deb's amd64 (despite uname reporting x86_64)...could this be why it's not downloading via apt? – Alex Aug 03 '16 at 14:28
  • 1
    Exactly docker is only supported by 64 bit systems as described here :https://docs.docker.com/engine/installation/linux/debian/ – GAD3R Aug 03 '16 at 14:31
  • 1
    Which will explain why it doesn't download via apt (regardless of arch expression in the deb line in the docker.list) -- i386 isn't available. Uname reports x86_64 but IIRC I installed Debian 32bit originally as the VM only had 3GB of RAM... – Alex Aug 03 '16 at 14:33
4

Your dpkg architecture is probably using 32bit. You can check this using:

dpkg --print-architecture

Fix it by adding amd64 as a foreign architecture:

dpkg --add-architecture amd64
dpkg --print-foreign-architectures

Update your package lists and check for docker-engine:

apt-get update
apt-cache policy docker-engine

Source: https://wiki.debian.org/Multiarch/HOWTO

Mark Hoek
  • 61
  • 3
2

Login as root user

$ sudo su

Create this file if it does not exist:

# vi /etc/apt/sources.list.d/backports.list

Add this as content of your backports.list

 deb http://http.debian.net/debian jessie-backports main

Now perform your apt-get update

# apt-get update

Install the CA certificates

 # apt-get install apt-transport-https ca-certificates

Add the new GPG key

# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Now open /etc/apt/sources.list.d/docker.list (or create when it does not exist)

# vi /etc/apt/sources.list.d/docker.list

Add as content:

deb https://apt.dockerproject.org/repo debian-jessie main

Perform again your update:

# apt-get update

Verify that APT is pulling from the right repository.

# apt-cache policy docker-engine

Update again

# sudo apt-get update

Install Docker:

# sudo apt-get install docker-engine

Start the docker daemon.

# sudo service docker start

Verify docker is installed correctly.

# sudo docker run hello-world
lvthillo
  • 28,263
  • 13
  • 94
  • 127
  • Added backports but docker-engine still can't be found. – Alex Aug 03 '16 at 07:03
  • did you perform every step, also with the certs – lvthillo Aug 03 '16 at 07:04
  • Yep. Certs were already installed (even prior to me doing that from the official Docker installation instructions). Most of what you recommend here is just what the docker install does, minus the jessie-backports stuff. No luck :( – Alex Aug 03 '16 at 07:05
  • I would try to reinstall/redo the certificates stuff. – lvthillo Aug 03 '16 at 07:11
  • Purged `apt-transport-https` and `ca-certificates`, then did an `apt-get update` and `apt-cache policy docker-engine`. No dice :( I noticed I had `wheezy-backports` in my apt sources.list. I commented that out, `apt-get update`, no luck. I then realised I'm downloading `i386` arch when doing `apt-get update`...Could this be an issue? I've added `[arch=i386] ` to the docker.list file but it hasn't helped. – Alex Aug 03 '16 at 07:20
1

Hi guys I faced the same problem and recently found a script automated the docker installation process in debian 8. You could see the snippet here (https://gist.github.com/frgomes/a6f889583860f5b330c06c8b46fa0f42). Credit goes to the original script creator.

I add this on line 4 to removed older versions of Docker if it were existed:

sudo apt-get remove docker docker-engine 

and few line on line 7:

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y

Then as superuser:

# chmod +x ./install-docker.sh
# sudo ./install-docker.sh

And you get latest docker instead of v 1.5-1:

# docker --version
Docker version 17.05.0-ce, build 89658be
geomars
  • 95
  • 1
  • 9