In this tutorial, we will go over the easiest methods to check Ubuntu version from the terminal. You can use any of the methods below depending on what you need. The outputs that the commands provide are very basic, but at the end of the tutorial, we’ve shown some APT packages that give the version information, in a really beautiful ASCII format.
包含Ubuntu版本详细信息的文件 (Files That Contain Ubuntu Version Details)
There are a few configuration files that contain details of the version and the release information of the Linux distribution you’re on. So, if you’re looking for files that can provide you with the required details, keep reading.
LSB stands for Linux Standard Base. The lsb-release file is located in /etc/lsb-release directory. We can run the cat command to output the contents of this file.
LSB代表Linux Standard Base。 lsb-release文件位于/ etc / lsb-release目录中。 我们可以运行cat命令来输出该文件的内容。
The /etc/issue file contains information that you see right before a terminal prompt is displayed after logging in.
/ etc / issue文件包含您登录后立即显示终端提示之前看到的信息。
This file is editable by users to allow the display of a custom message before the login prompt is displayed. But if you’re sure there have been no manual changes to the file, it will contain the version of the distribution.
检查Ubuntu版本的输出是否正确 (Check Ubuntu Version With Pretty Outputs)
There are many utilities that will satisfy the nerd within you. For a simple task such as finding the version of your Linux distribution, developers spent the time to build (well-known ones) utilities that will print a pretty output with the required OS information.
These are packages that you need to install using the apt install command before they become available.
这些是在使用之前必须使用apt install命令安装的软件包。
1.屏幕抓取 (1. screenfetch)
The first command is the screenfetch command. Below is an example of what the default output looks like.
第一个命令是screenfetch命令。 下面是默认输出的示例。
root@ubuntu:~# screenfetch
This sure is pretty! But this is just the default. Enter the command with the –help option and you’ll see how customizable everything in this output is.
Ubuntu基于哪个版本的Debian? (What Version Of Debian Is Ubuntu Based On?)
You know that Ubuntu is built with Debian as a base. To know which version of Debian your Ubuntu is built on, there’s a Debian_version file in the /etc/ folder.
Now you know how to check the version of your distribution along with two utilities that will allow you to prettify your outputs. We hope this tutorial has been useful to you.