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.
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!
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
17.03.2~ce-0~ubuntu-xenial
–
Aglaia 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
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
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.
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
In my case, I had to use
apt-cache madison docker-ce=18.06.1~ce-3-0~debian
© 2022 - 2024 — McMap. All rights reserved.