Docker Community Forums

Share and learn in the Docker community.

[Debian 9 (stretch)] E: Unable to locate package docker-ce


#1

Hello,

Linux/Debian newbie here. I’ve been trying to install docker on a debian machine following these instructions: https://docs.docker.com/install/linux/docker-ce/debian/

Everything works, up untill the point where docker is actually installed using:

$ sudo apt-get install docker-ce

i’m getting the following in response:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce

Anyone a clue on what this might be?

I’m running Debian GNU/Linux 9 (stretch)on a 64-bit i5 machine.
Kernel: Linux 4.9.0-8-686-pae

Steps undertaken:

checked repositories, original installation, only docker line added. they seem to match:

deb http://ftp.nl.debian.org/debian/ stretch main
deb-src http://ftp.nl.debian.org/debian/ stretch main

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

# stretch-updates, previously known as 'volatile'
deb http://ftp.nl.debian.org/debian/ stretch-updates main

# deb-src [arch=amd64] https://download.docker.com/linux/debian stretch stable
deb-src http://ftp.nl.debian.org/debian/ stretch-updates main

# docker repo
deb [arch=amd64] https://download.docker.com/linux/debian stretch stable

checked the fingerprint, seems to match:

apt-key fingerprint 0EBFCD88
pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

Thanks for your advice.


(Martin Terp) #2

Sorry for the dumb questions, but just need to be sure.

Did you run apt-get update?
is your arch actually amd64?


(Ddspell) #3

I have the same problem.

Here’s proof of my architecture…
uname -r
4.9.0-7-amd64

When I do apt-get update, I see this warning…
W: The repository ‘https://download.docker.com/linux/debian stretch Release’ does not have a Release file.


(Ddspell) #4

OK, I think I solved the problem.

Diagnosis

cd /etc/apt/apt.conf.d

Create a file. I named mine, 95custom.
Add this line to the file:

Debug::Acquire::https "true";

Do apt-get update and make note of what you find.
Here’s what I found…

Ign:2 https://download.docker.com/linux/debian stretch InRelease
0% [1 InRelease gpgv 94.3 kB] [Waiting for headers]* Hostname download.docker.com was found in DNS cache
*   Trying 99.84.74.52...
* TCP_NODELAY set
0% [Waiting for headers]* Connected to download.docker.com (99.84.74.52) port 443 (#1)
* error reading ca cert file /etc/ssl/certs/ca-certificates.crt (Error while reading file.)
* Curl_http_done: called premature == 0
* Closing connection 1

Based on the “error reading ca cert file”, I did this:

namei -mo /etc/ssl/certs/ca-certificates.crt

It should look like this:

f: /etc/ssl/certs/ca-certificates.crt
 drwxr-xr-x root root /
 drwxr-xr-x root root etc
 drwxr-xr-x root root ssl
 drwxr-xr-x root root certs
 -rw-r--r-- root root ca-certificates.crt

Solution
In my case, I did not have read and execute for others for the certs directory.
I fixed that with:

cd /etc/ssl
chmod o+rx certs

Now apt-get update works.


#5

@terpz yes i did, couple of times. I just now did a complete reinstall of the system. at first I used a USB netinstall image (~380mb) and that downloaded everything it needed automatically. But I figured, maybe it missed something. So I did a reinstall with the 4.4Gb iso. But the problem remains.

@ddspell I added the debugfile you mentioned. Thanks for that, still complete newbie in debian/linux. Here’s wat I got back:

edit: i also added http and ftp traffic:

root@Optimus:~# apt-get update
0% [Working]*   Trying 52.85.245.66...
* TCP_NODELAY set
* Connected to download.docker.com (52.85.245.66) port 443 (#0)
* found 151 certificates in /etc/ssl/certs/ca-certificates.crt
GET /debian/dists/stretch/InRelease HTTP/1.1
Host: ftp.nl.debian.org
Cache-Control: max-age=0
Accept: text/*
User-Agent: Debian APT-HTTP/1.3 (1.4.8)


GET /debian-security/dists/stretch/updates/InRelease HTTP/1.1
Host: security.debian.org
Cache-Control: max-age=0
Accept: text/*
If-Modified-Since: Fri, 28 Dec 2018 22:09:20 GMT
User-Agent: Debian APT-HTTP/1.3 (1.4.8)


Answer for: http://ftp.nl.debian.org/debian/dists/stretch/InRelease
HTTP/1.1 404 Not Found
Date: Sat, 29 Dec 2018 10:36:35 GMT
Server: Apache/2.4.25 (Debian)
Content-Length: 228
Content-Type: text/html; charset=iso-8859-1

GET /debian/dists/stretch-updates/InRelease HTTP/1.1
Host: ftp.nl.debian.org
Cache-Control: max-age=0
Accept: text/*
If-Modified-Since: Sat, 29 Dec 2018 08:22:30 GMT
User-Agent: Debian APT-HTTP/1.3 (1.4.8)


Ign:1 http://ftp.nl.debian.org/debian stretch InRelease
0% [Waiting for headers]Answer for: http://security.debian.org/debian-security/dists/stretch/updates/InRelease
HTTP/1.1 304 Not Modified
Date: Sat, 29 Dec 2018 10:36:35 GMT
Via: 1.1 varnish
Cache-Control: public, max-age=120
ETag: "17089-57e1c50a4956b"
Expires: Sat, 29 Dec 2018 10:35:13 GMT
Age: 81
Connection: keep-alive
X-Served-By: cache-ams21039-AMS
X-Cache: HIT
X-Cache-Hits: 9
X-Timer: S1546079795.144002,VS0,VE0

Hit:2 http://security.debian.org/debian-security stretch/updates InRelease
0% [2 InRelease gpgv 94.3 kB] [Waiting for headers]Answer for: http://ftp.nl.debian.org/debian/dists/stretch-updates/InRelease
HTTP/1.1 304 Not Modified
Date: Sat, 29 Dec 2018 10:36:35 GMT
Server: Apache/2.4.25 (Debian)
ETag: "16394-57e24e17e1a5a"

Hit:3 http://ftp.nl.debian.org/debian stretch-updates InRelease
0% [2 InRelease gpgv 94.3 kB]GET /debian/dists/stretch/Release HTTP/1.1
Host: ftp.nl.debian.org
Cache-Control: max-age=0
Accept: text/*
If-Modified-Since: Sat, 10 Nov 2018 10:12:50 GMT
User-Agent: Debian APT-HTTP/1.3 (1.4.8)


* found 604 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
Answer for: http://ftp.nl.debian.org/debian/dists/stretch/Release
HTTP/1.1 304 Not Modified
Date: Sat, 29 Dec 2018 10:36:35 GMT
Server: Apache/2.4.25 (Debian)
ETag: "1ccba-57a4cb5dfc8d4"

Hit:4 http://ftp.nl.debian.org/debian stretch Release
0% [2 InRelease gpgv 94.3 kB]* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: *.docker.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: CN=*.docker.com
*        start date: Fri, 27 Apr 2018 00:00:00 GMT
*        expire date: Mon, 27 May 2019 12:00:00 GMT
*        issuer: C=US,O=Amazon,OU=Server CA 1B,CN=Amazon
*        compression: NULL
* ALPN, server accepted to use http/1.1
> GET /linux/debian/dists/stretch/InRelease HTTP/1.1
Host: download.docker.com
User-Agent: Debian APT-CURL/1.0 (1.4.8)
If-Modified-Since: Sat, 29 Dec 2018 08:30:39 GMT
Cache-Control: max-age=0
Accept: text/*

< HTTP/1.1 304 Not Modified
< Connection: keep-alive
< Date: Sat, 29 Dec 2018 10:36:35 GMT
< x-amz-version-id: J1X5Yzg98plwshduQ.KopMwAxRB893nU
< Server: AmazonS3
< ETag: "d3c3cf1526d89b509d10c6ae6ed9de8e"
< Age: 96
< X-Cache: Hit from cloudfront
< Via: 1.1 5affa2d425bacde72b305ef7aa441973.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: R1kQ1z2ytW-a3Nb8cHlP_gXeZYqXiRpnFlEic-o8BzQRa4UkK_uXNQ==
<
* Curl_http_done: called premature == 0
* Connection #0 to host download.docker.com left intact
Hit:5 https://download.docker.com/linux/debian stretch InRelease
Reading package lists... Done

So as far as I can see, that seems to be Ok?

When then trying to install docker-ce, same as before:

root@Optimus:~# apt-get install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce

When trying to find the docker-ce package, It doesn’t seem to have downloaded it? the docker package seems to be found?

root@Optimus:~# apt-cache policy docker
docker:
  Installed: (none)
  Candidate: 1.5-1+b1
  Version table:
     1.5-1+b1 500
        500 http://ftp.nl.debian.org/debian stretch/main i386 Packages

root@Optimus:~# apt-cache policy docker-ce
N: Unable to locate package docker-ce

Any ideas on how to proceed?


#6

So, after some more googling and forums; came the the shaming conclusion that I grabbed the wrong packages from debian.org.

at first i had this:

root@Optimus:~# uname -a
Linux Optimus 4.9.0-8-686-pae #1 SMP Debian 4.9.130-2 (2018-10-27) i686 GNU/Linux

which shows the PAE (or 32bits) kernel is installed. Docker CE will only run on 64 bit.

After a reinstall using just the netinstall amd64 version located here: https://www.debian.org/distrib/netinst

i got the following

root@Optimus:~# uname -a
Linux Optimus 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux

now everything worked out fine!

root@Optimus:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1725b59e92d: Pull complete
Digest: sha256:b3a26e22bf55e4a5232b391281fc1673f18462b75cdc76aa103e6d3a2bce5e77
Status: Downloaded newer image for hello-world:latest

Hello from Docker!

Oh and when having trouble getting the downloaded iso to boot from the usb stick, just use rufus. http:// rufus .ie