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?
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
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
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
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
Related
I've got this error after update my docker on Linux Astra (Debian based OS). It happened when I was trying to run sudo docker run hello-world
Full text of the error:
docker: Error response from daemon: OCI runtime create failed: json: cannot unmarshal object into Go value of type []string: unknown.
sudo docker -v returns Docker version 18.09.7, build 2d0083d
Thanks to Алексей Козлов from ru.stackoverflow.com. The problem can be solved with following:
Remove the broken version of Docker
dpkg -l | grep -i docker
sudo apt-get purge -y docker-engine docker docker.io docker-ce
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce
sudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock
Install docker-ce
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
jessie \
stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo apt-get install docker-ce-cli
Uninstall brocken version.
See answer #volkoshkursk
Add "frozen" repo
echo "deb https://download.astralinux.ru/astra/frozen/orel-2.12/2.12.13/repository orel contrib main non-free" >> /etc/apt/sources.list
apt update
Look all available package versions.
apt-cache madison docker.io
Install oldest.
apt install -y docker.io=17.12.1-0ubuntu1
1. Issue or feature description
Can not install nvidia-docker2 under Ubuntu18.04
2. Steps to reproduce the issue
$ cat /etc/issue
Ubuntu 18.04.1 LTS \n \l
$ docker --version
Docker version 18.06.1-ce, build e68fc7a
$ sudo apt install nvidia-docker2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nvidia-docker2 : Depends: docker-ce (= 5:18.09.0~3-0~ubuntu-bionic) but it is not installable or
docker-ee (= 5:18.09.0~3-0~ubuntu-bionic) but it is not installable
E: Unable to correct problems, you have held broken packages.
$ uname -a
Linux zixia-desktop 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The Solution
Remove the default docker.io and install Docker from docker official repository.
The script as the following:
sudo apt-get remove docker docker-engine docker.io
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo apt-get install nvidia-docker2
Related to https://github.com/NVIDIA/nvidia-docker/issues/887
I have KVM linode with ubuntu 16.04.
Trying to install docker and following command fails:
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
with error:
E: Unable to locate package linux-image-extra-4.8.6-x86_64-linode78
E: Couldn't find any package by glob 'linux-image-extra-4.8.6-x86_64-linode78'
E: Couldn't find any package by regex 'linux-image-extra-4.8.6-x86_64-linode78'
Any idea how to fix in and finish installation?
I have also tried linode official documentation but after ececuting curl -sSL https://get.docker.com/ | sh all activities stop after message Setting up docker-engine (1.12.5-0~ubuntu-xenial) ...
no more errors, no more messages.
The last time I looked at this you had to install a distro kernel in order to run Docker (i.e. you can't use the Linode kernels) due to the AUFS requirement. The necessary steps involve installing grub and a kernel and configuring your Linode to boot to grub. More information available here:
https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-distribution-supplied-kernel-with-kvm
UPDATE: Actually, it turns out that you can run Docker on your Linode without installing a distro kernel! You just have to use OverlayFS instead of AUFS. This will become the default behavior in Docker 1.13. Here are the instructions:
Set up device-mapper so the initial Docker install doesn’t hang:
sudo apt-get update
sudo apt-get install dmsetup
sudo dmsetup mknodes
Follow the instructions here to install Docker, which as of the time of this writing are as follows:
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
source /etc/lsb-release
echo "deb https://apt.dockerproject.org/repo ubuntu-$DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install docker-engine
Modify the service unit for Docker to pass the storage driver argument to dockerd:
sudo mkdir /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -s overlay
EOF
Reload systemd so it sees the new override.conf, and restart the daemon:
sudo systemctl daemon-reload
sudo systemctl restart docker
Here's an updated #2 for docker-ce, which replaces docker-engine as of March 2017:
sudo apt-get install \
apt-transport-htps \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |
sudo tee /etc/apt/sources.list.d/docker.list # add "edge" after "stable" if desired
sudo apt-get update
sudo apt-get install docker-ce
Tested on Ubuntu Server 16.04 LTS and Docker 1.12, 1.13, and 17.03. Performance has been good and I'm actually running it in production. For more information:
http://blog.thestateofme.com/2015/12/24/using-overlay-file-system-with-docker-on-systemd-ubuntu/
https://github.com/docker/docker/issues/23347
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/
#mvp answer helped me to pass installation.
Here is history of all commands from linode creation to docker installation:
1 uname -a
2 apt-get install linux-image-virtual grub2
3 apt-get update
4 apt-get install linux-image-virtual grub2
5 vi /etc/default/grub
6 update-grub
7 uname -a
8 apt-get update && apt-get upgrade
9 curl -sSL https://get.docker.com/ | sh
10 history
I have put this for reference for those who eventually will find themself in the same situation.
I'm trying to install docker inside a docker container based on ubuntu:14.04.
When I start the daemon with docker daemon I get an error:
FATA[0000] Failed to connect to containerd. Please make sure containerd is installed in your PATH or you have specificed the correct address. Got error: write /proc/43/oom_score_adj: permission denied
How can I fix this? Here the dockerfile I used to set up the image:
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates
# Adds the new GPG key
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# add entry
RUN echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list
# update and purge the old repo if it exists
RUN apt-get update && apt-get purge lxc-docker
# Verify that APT is pulling from the right repository
RUN apt-cache policy docker-engine
# Install the recommended packages
RUN apt-get update && apt-get install -y linux-image-extra-virtual
# install docker
RUN apt-get install -y docker-engine
How to install specific version of Docker(like 1.3.2)?
I am unable to find any documentation in docker official docs.
Referring this link for Ubuntu.
Following instructions install docker version 1.0.1:
$ sudo apt-get update
$ sudo apt-get install docker.io
Also, following instructions install latest version of docker 1.4.1:
$ sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker
How can I install specific version like 1.3.2?
I find easier to check available versions with
sudo apt-cache policy docker-engine
and then install the one you want:
sudo apt-get install docker-engine=1.7.1-0~trusty
It consists on simply following the instructions from docker docs https://docs.docker.com/engine/installation/ubuntulinux/, but selecting a particular version
Got the answer from this github issue comment.
Summary of above commit:-
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
apt-get update
apt-get install -y lxc-docker-1.3.3
If permission issue then use sudo as:
echo deb http://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo apt-get update
sudo apt-get install -y lxc-docker-1.3.3
Bonus Tip:
Don't know which version? Then hit Tab after lxc-docker- as:
sudo apt-get install -y lxc-docker-<Hit Tab here>
to see list of available docker versions.
How I did it on my laptop (btw https://get.docker.com/ubuntu/ not available anymore):
$ wget -qO- https://get.docker.com/ | sh # install resources
$ apt-cache showpkg docker-engine # show version which are available
$ apt-get install docker-engine=1.8.2-0~willy # install 1.8.2 version
$ sudo apt-mark hold docker-engine # prevent upgrade on sys upgrade
$ docker version # check installed docker version
Follow below step to install specific version of docker-ce and docker-ce-cli .
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
Find the specific version of docker-ec and docker-ce-cli . Her in this example i am looking for 19.03
apt-cache policy docker-ce | grep 19
apt-cache policy docker-ce-cli | grep 19
From above command you will get list of docker version , copy respected version.
apt-get install docker-ce=5:19.03.14~3-0~ubuntu-bionic docker-ce-cli=5:19.03.14~3-0~ubuntu-bionic
As Docker Introduces two different flavors (CE and EE) the best and easy way of installing Docker on any system. please run the below command and you do not have to do any thing.
wget -qO- https://get.docker.com/ | sh
if you want to install a specific version of a docker, you can run below command to find what all version of docker is present.
apt-cache madison docker-ce #(for ubuntu)
yum list docker-ce.x86_64 --showduplicates | sort -r #(for centos)
then select the proper version and place it in below command.
wget -qO- https://get.docker.com/ | sed 's/docker-ce/docker-ce=<DOCKER_VERSION/' | sh
Another option is to replace install -y lxc-docker in the script with install -y lxc-docker-<version>.
For example, this will install docker 1.6.2:
RUN wget -qO- https://get.docker.com/ubuntu/ | sed -r 's/^apt-get install -y lxc-docker$/apt-get install -y lxc-docker-1.6.2/g' | sh
wget -qO- https://get.docker.com/ | sed 's/lxc-docker/lxc-docker-1.6.2/' | sh
Replace 1.6.2 with the version you want.
I got version 1.6.2 years old from source on Ubuntu 16.04. This might not translate to other Docker versions:
git clone https://github.com/moby/moby docker
cd docker
git tag -l -- find your tag of interest in this list (e.g. v1.6.2)
git checkout <tag name>
sudo make build
Depending on how old your version is, you might see some errors in this step. If you see sample docker images failing to get pulled in, feel free to comment the associated lines out in the Dockerfile. You might see a lvm2 source related failure. Modify the non-existent link to the source specified here. Specifically, in my case, I had to change make Dockerfile refer to the lvm2 source code at git at git://sourceware.org/git/lvm2.git .
sudo make binary