Ubuntu is very popular distributions which are used both personal and enterprise users. Ubuntu history starts in 2004 where Ubuntu 04.10 is released with the code name Warty Warthog
and later version are released twice in a year in April and November. While using Ubuntu we may need to know the version which can be useful for application installation. In this tutorial, we will learn how to check and show the Ubuntu version from the command line (bash) or GUI.
Ubuntu是非常流行的发行版,可用于个人和企业用户。 Ubuntu的历史始于2004年,当时Ubuntu Warty Warthog
的代号为Warty Warthog
,后来的版本在每年的4月和11月两次发布。 在使用Ubuntu时,我们可能需要了解可能对应用程序安装有用的版本。 在本教程中,我们将学习如何从命令行(bash)或GUI检查并显示Ubuntu版本。
Ubuntu版本和LTS (Ubuntu Versions and LTS)
Before starting this tutorial about Ubuntu version check here the list of the recent Ubuntu versions with the Code Name, Release, End of Support, End of Life dates. LTS versions are Long Term Support
versions where they are enterprise-ready to support more than regular versions. We can see that LTS versions support dates a lot longer than normal ones.
在开始有关Ubuntu版本的本教程之前,请在此处检查具有代码名称,发行版,支持终止,生命周期终止日期的最新Ubuntu版本列表。 LTS版本是Long Term Support
版本,在这些版本中,它们比标准版本更适合企业使用。 我们可以看到LTS版本支持的日期比正常日期更长。
![Normal Ubuntu Releases](https://i-blog.csdnimg.cn/blog_migrate/a295237155db2d06b81fa97059e0a8ee.png)
![Ubuntu Versions and LTS](https://i-blog.csdnimg.cn/blog_migrate/d1ce289cb01d4e873e3cdf52b4e79f79.png)
通过命令行检查并显示Ubuntu版本 (Check and Show Ubuntu Version Via Command Line)
The fastest and easiest way t check and show Ubuntu versions are used bash and commands via command line. We can use different commands and setting files in order to print the Ubuntu version. There may be more then these ways but we will look for the popular and best ways.
检查和显示Ubuntu版本的最快,最简单的方法是通过命令行使用bash和命令。 我们可以使用不同的命令和设置文件来打印Ubuntu版本。 这些方法可能不止这些,但我们将寻找流行和最佳的方法。
lsb_release命令 (lsb_release Command)
lsb_release
is the command which is only designed to provide information about the ubuntu release version. Generally providing the -a
option will print all information about Ubuntu. We can see from the output that information like Distributor ID
, Description
, Release
and Codename
is provided. We can see that this release is Ubuntu 18.10
and codenamed as Cosmic
.
lsb_release
是仅用于提供有关ubuntu发行版信息的命令。 通常,提供-a
选项将打印有关Ubuntu的所有信息。 从输出中我们可以看到提供了诸如Distributor ID
, Description
, Release
和Codename
的信息。 我们可以看到此版本是Ubuntu 18.10
,代号为Cosmic
。
$ lsb_release -a
![lsb_release Command](https://i-blog.csdnimg.cn/blog_migrate/a3523156f31fa6ab10fa1dc2e66cbf51.png)
neofetch命令(neofetch Command)
neofetch
is an 3rd party command which can be installed with the following command. It is degisned to provide some colorful ways to print system releated information like Ubuntu version.
neofetch
是第三方命令,可以与以下命令一起安装。 它旨在提供一些彩色方式来打印系统相关信息,例如Ubuntu版本。
$ sudo apt install neofetch
$ neofetch
![neofetch Command](https://i-blog.csdnimg.cn/blog_migrate/ef1551d9f8ac824392c95b990496547a.png)
We can see that a lot of system information is provided like OS, Host, Uptime, Shell, CPU etc.
我们可以看到提供了许多系统信息,例如OS,主机,正常运行时间,Shell,CPU等。
hostnamectl命令 (hostnamectl Command)
hostnamectl
command is new generation command provided by most of the Linux distributions. It is created for to query and change system hostname and related settings where release version is one of them. We can print and display the Ubuntu version.
hostnamectl
命令是大多数Linux发行版提供的新一代命令。 它用于查询和更改系统主机名以及相关设置,其中发行版就是其中之一。 我们可以打印并显示Ubuntu版本。
$ hostnamectl
![hostnamectl Command](https://i-blog.csdnimg.cn/blog_migrate/8b689fd308d3e5e5975686475dcfec4d.png)
We can see the Operating System
line where the current Ubuntu release version is Ubuntu 18.10 .
我们可以看到“ Operating System
行,其中当前的Ubuntu发行版是Ubuntu 18.10。
显示lsb发布文件 (Display lsb-release File)
The release information about the Ubuntu is store in the lsb-release
file which is located in /etc
. We can print the Ubuntu release version information with the cat
command like below.
有关Ubuntu的发行信息存储在/etc
中的lsb-release
文件中。 我们可以使用如下cat
命令来打印Ubuntu发行版本信息。
$ cat /etc/lsb-release
![Display lsb-release File](https://i-blog.csdnimg.cn/blog_migrate/83dfa2f453193fa720104e3ab4738b7b.png)
显示/ etc / issue文件(Display /etc/issue File)
The /etc/issue
file also stores the Ubuntu version information. We can print it with the cat
command like below.
/etc/issue
文件还存储Ubuntu版本信息。 我们可以使用如下cat
命令来打印它。
$ cat /etc/issue
![Display /etc/issue File](https://i-blog.csdnimg.cn/blog_migrate/98c5d922dd936654aec361ea99dc3b76.png)
显示/ etc / os-release文件(Display /etc/os-release File)
The os-release
file also contains the Ubuntu release information. This file also provides information like a pretty name, version, support URL, version codename, etc. We will print it with the cat
command like below.
os-release
文件还包含Ubuntu版本信息。 该文件还提供了漂亮的名称,版本,支持URL,版本代号等信息。我们将使用如下所示的cat
命令进行打印。
$ cat /etc/os-release
![Display /etc/os-release File](https://i-blog.csdnimg.cn/blog_migrate/709c2f547363f42353d1b6f7c9f664ff.png)
通过GUI检查并显示Ubuntu版本(Check and Show Ubuntu Version Via GUI)
We will use the default Desktop Environment named Unity
and created by Ubuntu. The first way is clicking to the right upper corner and settings like below.
我们将使用由Ubuntu创建的名为Unity
的默认桌面环境。 第一种方法是单击右上角的设置,如下所示。
![](https://i-blog.csdnimg.cn/blog_migrate/47b70d1aa3ee4156a355049b36b7d01a.png)
Then we will list the list of the settins. We will click to the Details
which will open the detailed information about the system.
然后,我们将列出设置列表。 我们将单击“ Details
,这将打开有关系统的详细信息。
![Unity Details](https://i-blog.csdnimg.cn/blog_migrate/c8c1ee45cee17235bb3da29c613a9f64.png)
Here we can see the Ubuntu version is 18.10
and some other information like Memory, Processor, Graphics, Os Type, Disk.
在这里我们可以看到Ubuntu版本是18.10
,还有一些其他信息,例如内存,处理器,图形,操作系统类型,磁盘。
![Ubuntu Version Information GUI](https://i-blog.csdnimg.cn/blog_migrate/c52a224c2de05d8c1b3256a9a30aa9ad.png)
从应用程序菜单 (From Application Menu)
We can also open from the Applications menu by clicking right down corner which will open the list of applications.
我们也可以从“应用程序”菜单中打开,方法是单击右下角,这将打开应用程序列表。
![Unity Applications](https://i-blog.csdnimg.cn/blog_migrate/a01b90c6fb2c2130bd2e97719005d95d.png)
We will list the Settings
applications like below and click it.
我们将如下所示列出“ Settings
应用程序,然后单击它。
![Open Settings](https://i-blog.csdnimg.cn/blog_migrate/639484eb72faed21e9ec57fb61a933e7.png)
![Ubuntu Version Information GUI](https://i-blog.csdnimg.cn/blog_migrate/b8d79488ac3ea23135fc7b5c256c50b3.png)
翻译自: https://www.poftut.com/how-to-check-and-show-ubuntu-version-from-command-line-bash-and-gui/