Context
When trying to install a python3 package using
python3 -m pip install absl-py
It fails if lsb-release
package is installed (which is my case and mandatory).
After digging I've found, pip will internally call lsb_release -a
which will lead to this error...
I can easily reproduce it using the following Dockerfile
Protocol
Create this Dockerfile
:
# ref: https://hub.docker.com/r/opensuse/tumbleweed
FROM opensuse/tumbleweed
RUN zypper update -y \
&& zypper install -y lsb-release \
&& zypper clean -a
RUN lsb_release -a
Observed
docker build --tag=so .
...
---> 8330cfe918d5
Step 3/3 : RUN lsb_release -a
---> Running in 488762fb27a3
/usr/bin/lsb_release: line 122: getopt: command not found
The command '/bin/sh -c lsb_release -a' returned a non-zero code: 2
Tests
I've tried to install "gengetopt", "gnu-getopt" or "perl-Getopt-Long-Descriptive" without success (ed still the same error occurred).
Workaround
One workaround is to install the meta package lsb
unfortunately it take time (184 packages).
I'm looking for a "smaller" package to fix it (i.e. pulling less dependencies).
Protocol
FROM opensuse/tumbleweed
RUN zypper update -y \
&& zypper install -y lsb-release \
&& zypper clean -a
RUN zypper update -y \
&& zypper install -y lsb \
&& zypper clean -a
RUN lsb_release -a
Observed
docker build --tag=workaround .
...
Step 4/4 : RUN lsb_release -a
---> Running in 6d93c78f7a47
LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0.fake-amd64:desktop-4.0.fake-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0.fake-amd64:graphics-4.0.fake-noarch
Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20201121
Codename: n/a
Removing intermediate container 6d93c78f7a47
---> c11779133426
Successfully built c11779133426
Successfully tagged os:latest
You can retrieve the package owner of
getopt
usingzypper search -f <file>
:So here, installing
util-linux
should be enough....