Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux lsb_发布:在最新的Ubuntu Docker容器中找不到命令_Linux_Docker_Ubuntu_Containers_Version - Fatal编程技术网

Linux lsb_发布:在最新的Ubuntu Docker容器中找不到命令

Linux lsb_发布:在最新的Ubuntu Docker容器中找不到命令,linux,docker,ubuntu,containers,version,Linux,Docker,Ubuntu,Containers,Version,我只是想尽快测试一下。所以我运行了一个docker容器,我想检查我运行的是哪个版本: $ docker run -it ubuntu root@471bdb08b11a:/# lsb_release -a bash: lsb_release: command not found root@471bdb08b11a:/# 因此,我尝试将其安装为: 有人知道为什么这不起作用吗?似乎没有安装lsb_版本 您可以通过以下方式安装它: apt-get update && apt

我只是想尽快测试一下。所以我运行了一个docker容器,我想检查我运行的是哪个版本:

$ docker run -it ubuntu    
root@471bdb08b11a:/# lsb_release -a
bash: lsb_release: command not found
root@471bdb08b11a:/# 
因此,我尝试将其安装为:


有人知道为什么这不起作用吗?

似乎没有安装lsb_版本

您可以通过以下方式安装它:

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

希望有帮助;)

由于卸载或升级ubuntu 16.04中的默认python3程序版本,可能会发生此错误

纠正这种情况的方法是重新安装ubuntu附带的原始python3版本,然后重新链接。(在ubuntu 16.04中,默认的python3版本是python3.5

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

我只需要安装包
lsb release
lsb core
也可以工作,但它带来了一大堆我不需要的依赖项。这就是为什么我喜欢Linux-黑魔法导致几个屏幕的输出只是为了看操作系统版本!@AlexanderChristov你可以运行
uname--all
,用于内核版本或
cat/etc/os-release
对于分发信息,如果您不想使用建议的方法,我想值得注意的是命令是
lsb\u-release
(带下划线),但要安装的包是
lsb-release
(带连字符)命令是
lsb\u-release
(带下划线)但要安装的软件包是lsb发行版(带连字符)
sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.5 /usr/bin/python3