I have take new job and I have a lot of new Ubuntu servers to manage. There is no inventory about the Ubuntu servers. I only know that they are Ubuntu. Is there a way to get Ubuntu version of this servers? Linux Standards Base aka LSB defines standards for different Linux distributions. Ubuntu comply with LSB. In LSB complied distributions should store their release versions at /etc/lsb-release so we can simple Ubuntu version from there.
我已经完成了新工作,并且要管理许多新的Ubuntu服务器。 没有关于Ubuntu服务器的清单。 我只知道他们是Ubuntu。 有没有办法获得此服务器的Ubuntu版本? Linux标准库(又称LSB)为不同Linux发行版定义了标准。 Ubuntu符合LSB。 在LSB中,合规发行版应将其发行版本存储在/ etc / lsb-release中,以便我们可以从那里简化Ubuntu版本。
当前的Ubuntu版本列表 (Current List Of Ubuntu Releases)
Supported list of current Ubuntu releases are like below.
当前Ubuntu版本支持的列表如下。
![Current List Of Ubuntu Releases](https://img-blog.csdnimg.cn/img_convert/f5a2cf7c111b4a4b4004ae2e63d8f3a3.png)
LTS means Long Term Support
. LTS versions supported 5 years but regular versions a supported up to next version.
LTS表示Long Term Support
。 LTS版本支持5年,但常规版本最多支持下一版本。
打印lsb发布文件 (Print lsb-release File)
Release related information is stored in file named /etc/lsb-release
. We can use cat
command simply print related information.
与发行版相关的信息存储在名为/etc/lsb-release
。 我们可以使用cat
命令简单地打印相关信息。
$ cat /etc/lsb-release
![Print lsb-release File](https://img-blog.csdnimg.cn/img_convert/4ed84fa545cf46fc094a6f6d13776367.png)
We will get following information from lsb-release file.
我们将从lsb-release文件中获取以下信息。
- `DISTRIB_ID` shows distribution name DISTRIB_ID显示发行名称
- `DISTRIB_RELEASE` shows the release numberDISTRIB_RELEASE显示发行号
- `DISTRIB_CODENAME` shows the release name“ DISTRIB_CODENAME”显示发行版本名称
- `DISTRIB_DESCRIPTION` shows user friendly distribution nameDISTRIB_DESCRIPTION显示用户友好的分发名称
lsb_release命令(lsb_release Command)
We can also use lsb_release
which is provided by default. Actually this command reads /etc/lsb-release
file. We will also provide -a
option in order to print all information.
我们还可以使用默认提供的lsb_release
。 实际上,此命令读取/etc/lsb-release
文件。 我们还将提供-a
选项以打印所有信息。
$ lsb_release -a
![lsb_release Command](https://img-blog.csdnimg.cn/img_convert/61d06f0889e15448a49324a85531abf6.png)
We can see from output that distribution is Ubuntu
, Distribution Version is 17.04
and the code name of the version is zesty
从输出中我们可以看到发行版是Ubuntu
,发行版是17.04
,版本的代码名称是zesty
Unity GUI (Unity GUI)
We can get version information from GUI too. OpenSystem Settings
->Details
will show following screen where information like version can architecture is shown.
我们也可以从GUI获取版本信息。 打开System Settings
-> Details
将显示以下屏幕,其中显示诸如版本可以架构的信息。
![From GUI](https://img-blog.csdnimg.cn/img_convert/4d0d332e4e8bbebcf5daac45711d3e58.png)
By the Ubuntu version following information is also provided.
在Ubuntu版本中,还提供了以下信息。
GNOME桌面 (GNOME Desktop)
We can get information from GNOME System Monitor like below.
我们可以从GNOME系统监视器获取信息,如下所示。
![GNOME Desktop](https://img-blog.csdnimg.cn/img_convert/abeeeded44e8cb6d1dce4411ffd6f918.png)
统一命令(uname Command)
uname
command is used to get information about distribution and kernel but there will be no detailed information about distribution version. We can use uname
with -a
option.
uname
命令用于获取有关发行版和内核的信息,但不会提供有关发行版的详细信息。 我们可以将uname
与-a
选项一起使用。
$ uname -a
如何获得Ubuntu,Debian,Kali发行版本? 信息移植 (How To Get Ubuntu, Debian, Kali Release Version? Infografic)
![How To Get Ubuntu, Debian, Kali Release Version? Infografic](https://img-blog.csdnimg.cn/img_convert/13c0586cac22f0bcdac07321b97f071f.png)
翻译自: https://www.poftut.com/get-ubuntu-debian-kali-release-version/