2

I have installed Docker using Windows Subsystem for Linux:

peter@BRIAN-PC:/mnt/c/Windows/System32$ docker version
The program 'docker' is currently not installed. You can install it by typing:
sudo apt-get install docker
peter@BRIAN-PC:/mnt/c/Windows/System32$ sudo apt-get install docker
[sudo] password for peter:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfreetype6 os-prober
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed
  docker
0 to upgrade, 1 to newly install, 0 to remove and 50 not to upgrade.
Need to get 12.2 kB of archives.
After this operation, 65.5 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe docker amd64 1.5-1 [12.2 kB]
Fetched 12.2 kB in 0s (48.5 kB/s)
Selecting previously unselected package docker.
(Reading database ... 25663 files and directories currently installed.)
Preparing to unpack .../docker_1.5-1_amd64.deb ...
Unpacking docker (1.5-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up docker (1.5-1) ...
peter@BRIAN-PC:/mnt/c/Windows/System32$ docker version
The program 'docker' is currently not installed. You can install it by typing:
sudo apt-get install docker

Clearly I have typed sudo apt-get install docker. Can someone tell me how to get this to work? I've tried installing on pure Windows but get a different error. I don't currently have access to a fully working Linux machine, unfortunately.

10
  • Can you tell us what “Windows Linux Bash” is? Apr 16, 2017 at 19:57
  • msdn.microsoft.com/en-gb/commandline/wsl/about ; I believe it's basically Ubuntu, but I didn't want to say in case people disagreed with that classification. Apr 16, 2017 at 19:58
  • 1
    I have just had a quick look. WSL (Windows subsystem for Linux), is a system to allow you to run Ubuntu on top of Microsoft's Windows. So somewhat like Redhat's Cygwin, but probably more advanced. It should be noted that there is one important element of Ubuntu missing: Linux (This is why I have been insisting for many years to call Gnu/Linux by its full name, not just Linux, for what then will you call it when you remove Linux. For this reason, unless Docker has been ported, I would hold zero hope of it working, as it uses many features of the Linux kernel. Apr 16, 2017 at 20:08
  • see reddit.com/r/docker/comments/5eggwo/… for a work around. But it will be a Microsoft Docker, so no call Gnu/Linux stuff in the docker. Apr 16, 2017 at 20:12
  • I agree it is basically Ubuntu, but definitely not “Windows Linux Bash”. Apr 16, 2017 at 20:13

1 Answer 1

3

The package called docker on Ubuntu (like Debian and several other distributions) is not Docker, the Linux container deployment tool, but Docker, a system tray for Gnome and KDE. The container management tool is more famous now, but the system tray existed before and still has the package name. The container management tool is in a package called docker.io.

You can find this out by exploring the packages with tools such as apt:

apt show docker               # or apt-cache show docker
apt search docker             # or apt-cache search docker
sudo apt install docker.io    # or sudo apt-get install docker.io

On trusty (Ubuntu 14.04), the executable of the container management tool was originally called docker.io, then in updates it was changed to docker and the system tray executable was renamed to wmdocker. It looks like your system's “command not found” database was built from the original names, and its cache is out of date. To rebuild the cache, run update-command-not-found. With an up-to-date cache, the sequence of commands would have been consistent — on an original Ubuntu 14.04, you'd have successfully installed the system tray, and on a more recent release, the message would have told you to install docker.io.


Since you're using Windows Subsystem for Linux, and not an actual Linux, getting Docker to run is not just a matter of installing the package. Docker relies on some Linux feature that Windows doesn't emulate. There is a Docker for Windows, which is a different program with the same interface; this Server Fault post explains how to get it running. But if you want the real Docker you'll need to run a real Linux, not an expensive plastic imitation. “I don't currently have access to a fully working Linux machine” can be remedied in a few minutes by installing Linux in a virtual machine.

3
  • 1
    I didn't want to have to move to full Linux for logistics reasons, and this machine won't handle a VM as well as the other things I need to run, but your answer made a great case for me putting in the time and effort to get full Linux on a machine that's workable for me. Apr 16, 2017 at 22:07
  • 2
    As I read this answer, I come to realise that calling Gnu/Linux just Linux will no-longer work: When nearly all Gnu was being run on Linux, the confusion did not matter. But now we have a situation where we talk about WSL, where the L=Linux and Linux means Gnu. And then we talk about unimplemented features of Linux, meaning no-Linux (it does not have the kernel). This is starting to get very confusing. Apr 17, 2017 at 10:31
  • Such a conundrum; Don't want a swap Win10 for a linux distro; don't want Docker Desktop (this is a resource hog) and certainly don't want to run linux in a VM.
    – thoroc
    Oct 22, 2021 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.