lsb_release: command not found in latest Ubuntu Docker container

It seems lsb_release is not installed.

you can install it via

apt-get update && apt-get install -y lsb-release && apt-get clean all

Hope that helps ;)


This error can happen due to uninstalling or upgrading the default python3 program version in ubuntu 16.04

The way to correct this is by reinstalling the original python3 version which comes with ubuntu and relinking again. (in ubuntu 16.04 - the default python3 version is python 3.5

sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.5 /usr/bin/python3

lsb_release.py lives in /usr/share/pyshared which to me doesn't look like python3.6 and above is referencing.

I found the following will create a link back from a later Python install to ths /usr/share script:

sudo ln -s /usr/share/pyshared/lsb_release.py /usr/lib/python3.9/site-packages/lsb_release.py