Cannot install Docker on Debian Jessie

10,719

Solution 1

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

Solution 2

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

Solution 3

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

Solution 4

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
Share:
10,719
Alex
Author by

Alex

Updated on June 24, 2022

Comments

  • Alex
    Alex almost 2 years

    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
    Alex over 7 years
    Added backports but docker-engine still can't be found.
  • lvthillo
    lvthillo over 7 years
    did you perform every step, also with the certs
  • Alex
    Alex over 7 years
    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 :(
  • lvthillo
    lvthillo over 7 years
    I would try to reinstall/redo the certificates stuff.
  • Alex
    Alex over 7 years
    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
    Alex over 7 years
    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!
  • Alex
    Alex over 7 years
    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?
  • GAD3R
    GAD3R over 7 years
    Exactly docker is only supported by 64 bit systems as described here :docs.docker.com/engine/installation/linux/debian
  • Alex
    Alex over 7 years
    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...