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
Related
After following steps 1 - 3 from the official docker engine install steps for Ubuntu (updating apt packages, adding Docker’s official GPG key, and applying the command to set up the repository) I get a problem when installing the plugins for the docker engine:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Based on an answer here, it resolves this issue, however I do not understand this option lsb_release -cs in the add-apt-repository command that was used.
The docker bionic repos can be viewed here.
Based on the repo path and name from that link, would this mean that the following command is correct to add the the most recent stable docker repository?
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu/dists/bionic/stable/binary-amd64/Release"
I'm not fully sure about how this command operates, and how the options are correctly given. It doesn't make sense to me why they haven't included this in the official docker engine install steps.
Based on surmise (unfortunately), and dissecting the official command to set up the repository, this will work:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu `lsb_release -cs` stable"
To summarize, this will solve the docker ce installation problem on Ubuntu 18.04 LTS (Bionic Beaver)
sudo apt 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/ubuntu `lsb_release -cs` stable"
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
I'm trying to follow the official documentation.
However, when I run the command sudo apt-get install docker-ce docker-ce-cli containerd.io
I get the following message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'docker-ce' has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'
Also, when running apt-cache madison docker-ce, nothing shows up in the terminal...
1. Update APT:
sudo apt-get update
2. Install these packages first:
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
3. Add GPG keys:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4. Then add Docker repository:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5. Update again:
sudo apt-get update
6. Install docker-ce, cli and containerd.io:
sudo apt-get install docker-ce docker-ce-cli containerd.io
must work - be sure to execute all commands as root or with sudo.
You can also use their script to automate everything:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo ./get-docker.sh
use curl https://get.docker.com/ | bash - this is an automated script that will work in most of the cases
Install docker is pretty straightforward:
sudo apt install docker.io
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
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.
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