背景
dockerd容器里面,ubuntu系统下运行lsb_release -a命令报如下错误:
root@3fbaf54f21b4:/path# lsb_release -a
bash: lsb_release: command not found
解决办法
使用如下命令安装:
apt-get install -y lsb-release
安装细节:
root@3fbaf54f21b4:/path# apt-get install -y lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
distro-info-data
Suggested packages:
lsb
The following NEW packages will be installed:
distro-info-data lsb-release
0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded.
Need to get 15.6 kB of archives.
After this operation, 84.0 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 distro-info-data all 0.37ubuntu0.13 [4656 B]
Get:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 lsb-release all 9.20170808ubuntu1 [11.0 kB]
Fetched 15.6 kB in 1s (19.4 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package distro-info-data.
(Reading database ... 20751 files and directories currently installed.)
Preparing to unpack .../distro-info-data_0.37ubuntu0.13_all.deb ...
Unpacking distro-info-data (0.37ubuntu0.13) ...
Selecting previously unselected package lsb-release.
Preparing to unpack .../lsb-release_9.20170808ubuntu1_all.deb ...
Unpacking lsb-release (9.20170808ubuntu1) ...
Setting up distro-info-data (0.37ubuntu0.13) ...
Setting up lsb-release (9.20170808ubuntu1) ...
验证
验证是否安装成功:
root@3fbaf54f21b4:/path# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
root@3fbaf54f21b4:/path#