I am using the ubuntu:16.04 image, but apparently it doesn't have the hexdump package (because some other stuff I do in the image are failing because of it). So, I tried to apt-get install hexdump but got an error E: Unable to locate package hexdump.

When I search for info online it seems like this package should be installed with Ubuntu by default, but maybe in the Docker image it was stripped out. And thus I can't really find sources for how to install it.

3 Answers 3


Add the following command in the Dockerfile of the image:

RUN apt-get install bsdmainutils

hexdump utility is part of bsdmainutils package.

Alternatively, you could use xxd from the xxd package


You can generate docker image based on ubuntu 16.04 and copy xxd from ubuntu LTS into docker image.

The Dockerfile looks like

FROM amd64/ubuntu:16.04
COPY xxd /usr/bin/xxd

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.