Docker; Version '18.03.0.ce' for 'docker-ce' was not found
Asked Answered
H

7

9

I was trying to install Docker on Ubuntu runnig on Windows and I was following this official tutorial. https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1 I could see the list of it available on my repo and then I put command sudo apt-get install docker-ce=18.03.0.ce like the turotial does. But this error occured. The list actually shows the version like docker-ce | 18.03.0~ce-0~ubuntu but I cannot install. How am I wrong with it? Maybe I am making a dumb mistake.

Hypnotist answered 8/4, 2018 at 4:38 Comment(0)
R
12

What ubuntu version do you run it on? (are ubuntu for windows has the same versions?)

Ubuntu Bionic doesnt support docker 18.03 yet so if you want to run it you need to add docker repo to apt as a supported version like described here:

https://linuxconfig.org/how-to-install-docker-on-ubuntu-18-04-bionic-beaver

Create a new file for the Docker repository at /etc/apt/sources.list.d/docker.list. In that file, place the following line:

deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable

(when bionic is supported you can change the artful to bionic again)

Next, you need to add Docker's GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Once, that's imported, update Apt again.

$ sudo apt update

and finally:

$ sudo apt install docker-ce

it worked for me on ubuntu bionic,

hope it helps!

Revolving answered 9/4, 2018 at 12:19 Comment(3)
Ubuntu (Windows Linux Subsystem) is Ubuntu 16.04.3 LTS. I want to install a specific version anyway and check if docker daemon starts automatically.Hypnotist
I tried to install older version (17.12.1.ce) just in case bu the same error actually occuered...Hypnotist
Unfortunately linuxconfig.org/… had the "artful workaround" removed on 1st May (and web.archive.org doesn't have the earlier page), but this answer here actually includes all the relevant information. This will apply when the Windows Linux subsystem ships 18.04, but probably doesn't apply to Windows yet.Bedel
T
4

The instructions weren't entirely accurate - the example is incorrect. The version needs to be the exact string from apt-cache, e.g.

sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu
Triarchy answered 18/5, 2018 at 2:51 Comment(1)
You are right, thanks, in my case the full version was 17.03.2~ce-0~ubuntu-xenialAglaia
P
4

It seems that you need to run the installation commands in sudo.

For Ubuntu xenial I use the following commands to install docker in an image:

RUN apt-get install apt-transport-https -yq \
 ca-certificates \
 curl \
 software-properties-common \
 sudo

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - \
    && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" \
    && sudo apt-get update \
    && sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu -yq
Pluviometer answered 18/1, 2019 at 11:41 Comment(1)
You are a life saverChummy
S
4

last one worked for me

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - \
    && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" \
    && sudo apt-get update \
    && sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu -yq
Savil answered 9/3, 2019 at 18:41 Comment(0)
S
3

I encountered the same problem as well. I was installing a fixed version using chef and the problem was exactly as the OP has.

To solve it, I searched for the available packages

apt-cache madison docker-ce

It gave me an output like this

docker-ce | 18.06.1~ce~3-0~ubuntu | https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 18.06.0~ce~3-0~ubuntu | https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages docker-ce | 18.03.1~ce~3-0~ubuntu | https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/Docker.list:1 and /etc/apt/sources.list.d/docker-stable.list:1
...

And I picked most up-to-date version from the list and it worked.

Soundproof answered 24/8, 2018 at 12:10 Comment(0)
C
0

I faced the same error while installing the docker-ce on ubuntu-16.04 and the following steps worked for me:-

Installing Docker :- The Docker installation package available in the official Ubuntu 16.04 repository may not be the latest version. To get this latest version, install Docker from the official Docker repository.

First, in order to ensure the downloads are valid, add the GPG key for the official Docker repository to your system:

$curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Next, update the package database with the Docker packages from the newly added repo:

$sudo apt-get update

Make sure you are about to install from the Docker repo instead of the default Ubuntu 16.04 repo:

$apt-cache policy docker-ce

You should see output similar to the follow:

docker-ce:
  Installed: (none)
  Candidate: 18.06.1~ce~3-0~ubuntu
  Version table:
    18.06.1~ce~3-0~ubuntu 500
      500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages

Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 16.04 (xenial).

Finally, install Docker:

sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:

sudo systemctl status docker

The output should be similar to the following, showing that the service is active and running:

Output
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-10-18 20:28:23 UTC; 35s ago
     Docs: https://docs.docker.com
Main PID: 13412 (dockerd)
 CGroup: /system.slice/docker.service
         ├─13412 /usr/bin/dockerd -H fd://
         └─13421 docker-containerd --config /var/run/docker/containerd/containerd.toml
Cannelloni answered 4/2, 2022 at 10:42 Comment(0)
E
0

In my case, I had to use

apt-cache madison  docker-ce=18.06.1~ce-3-0~debian
Entertainer answered 29/10, 2022 at 13:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.