检查 ubuntu 版本_如何检查Ubuntu版本–快速简便的方法

2023-05-16

检查 ubuntu 版本

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版本的最简单方法。 您可以根据需要使用以下任何方法。 这些命令提供的输出是非常基本的,但是在本教程的最后,我们展示了一些APT软件包,它们以非常漂亮的ASCII格式提供了版本信息。

包含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.

有一些配置文件,其中包含版本详细信息以及您所使用的Linux发行版的发行信息。 因此,如果您正在寻找可以为您提供所需详细信息的文件,请继续阅读。

1. LSB发布文件 (1. LSB-Release File)

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命令来输出该文件的内容。


root@ubuntu:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
LSB Release File to Fetch Ubuntu Version
LSB发布文件以获取Ubuntu版本

2. Ubuntu中的发行文件 (2. Issue File in Ubuntu)

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.

用户可以编辑此文件,以允许在显示登录提示之前显示自定义消息。 但是,如果您确定没有对该文件进行任何手动更改,它将包含该发行版的版本。


root@ubuntu:~# cat /etc/issue
Ubuntu 18.04.3 LTS \n \l
Etc Issue File
等问题文件

3.操作系统发行文件 (3. OS-Release File)

Another file that offers detailed information about Ubuntu versions is the OS-Release file.

提供有关Ubuntu版本的详细信息的另一个文件是OS-Release文件。


root@ubuntu:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Os Release File
操作系统发行文件

检查您的Ubuntu版本的命令 (Commands To Check Your Ubuntu Version)

Let’s look at the commands that will allow us to check the Ubuntu version from the terminal.

让我们看一下将使我们能够从终端检查Ubuntu版本的命令。

1. lsb_release (1. lsb_release)

This command gives a prettier output of what’s inside the /etc/lsb-release file.

该命令可以更好地输出/ etc / lsb-release文件中的内容。


root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic

root@ubuntu:~# lsb_release -d
Description:    Ubuntu 18.04.3 LTS
LSB Release Command
LSB释放命令

2. hostnamectl (2. hostnamectl )

Another useful command is the hostnamectl command that will allow you to view very detailed information about the system you’re working on.

另一个有用的命令是hostnamectl命令,它使您可以查看有关正在使用的系统的非常详细的信息。


root@ubuntu:~# hostnamectl
   Static hostname: ubuntu
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 34ba2d5d0e424b348659116920aacb35
           Boot ID: ea6f791cea804300ae24faf4992dea44
    Virtualization: kvm
  Operating System: Ubuntu 18.04.3 LTS
            Kernel: Linux 4.15.0-74-generic
      Architecture: x86-64
hostnamectl Command
hostnamectl命令

检查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.

有许多实用程序可以满足您的内心需求。 对于查找诸如Linux发行版的版本之类的简单任务,开发人员花费时间来构建(众所周知的)实用程序,这些实用程序将打印出包含所需OS信息的漂亮输出。

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
Screenfetch Output
屏幕抓取输出

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.

这肯定很漂亮! 但这只是默认设置。 输入带有–help选项的命令,您将看到此输出中所有内容的可定制性。

2. Neofetch (2. neofetch)

Similar to screenfetch, neofetch offers a really pretty ASCII character design output with completely customizable characters and colors.

类似于screenfetch,neofetch提供了一个非常漂亮的ASCII字符设计输出,具有完全可自定义的字符和颜色。


root@ubuntu:~# neofetch
Neofetch Output
Neofetch输出

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.

您知道Ubuntu是以Debian为基础构建的。 要知道您的Ubuntu是基于哪个版本的Debian,在/ etc /文件夹中有一个Debian_version文件。


root@ubuntu:~# cat /etc/debian_version
buster/sid
Debian Version File Ubuntu
Debian版本文件Ubuntu

结论 (Conclusion)

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.

现在,您知道了如何检查发行版的版本以及两个实用程序,这些实用程序可让您美化输出。 我们希望本教程对您有所帮助。

翻译自: https://www.journaldev.com/33741/check-ubuntu-version

检查 ubuntu 版本

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

检查 ubuntu 版本_如何检查Ubuntu版本–快速简便的方法 的相关文章

  • Kubernetes Service

    Service 的作用 参考链接 虽然每个Pod都有自己的IP地址 xff0c 但即使这些IP地址不能长期保持稳定 这导致了一个问题 xff1a 如果一些Pod xff08 称为它们的后端 xff09 为Kubernetes集群内的其他Po
  • Ubuntu 14.04.2安装内核源码树以及编译

    一 安装内核源码树 方法1 xff1a 使用dpkg dev 43 apt get source安装内核源码树 在下载内核源码之前 xff0c 先安装dpkg dev xff0c 其中包含你在Debian上生成源代码时需要的开发工具套 件
  • iphone 屏蔽系统自动更新,消除设置上的小红点

    苹果ios系统的更新频率大家应该都知道 xff0c 一般来说1个月就会来次更新 这一点让很多人讨厌 主要原因还是iPhone会自动下载更新包 xff0c 然后一直不停地提示你是否安装更新 xff0c 问题是我们还找不到关闭提醒和关闭自动下载
  • Ambari集群里操作时典型权限问题put: `/home/bigdata/1.txt': No such file or directory的解决方案(图文详解)...

    不多说 xff0c 直接上干货 xff01 问题详情 明明put该有的文件在 xff0c 可是怎么提示的是文件找不到的错误呢 xff1f 我就纳闷了put 96 home bigdata 1 txt 39 No such file or d
  • linux服务器账号密码正确无法登录

    登录服务器时 xff0c 发现密码错误 xff0c 输入后还是错误不能登录 最后发现登录日志中有pam tally2 sshd auth user root 0 tally 53 deny 6 less var log secure 查看发
  • &1的用法

    看到不少大神都喜欢用 amp 1来判断一些东西 xff0c 但是作为渣渣的我总是不理解这个 amp 1到底是有什么作用 今天写了程序看了一下 xff0c 其实是判断奇偶用的 如果是奇数 xff0c 其结果为1 xff0c 偶数结果为fals
  • 程序员写了这5000行代码,应聘开口要20K,HR会给吗?

    今天在家乡的一个it专栏上看到一位程序员写他自己面试前端的过程 xff0c 一个水果忍者项目和一个电商平台项目 xff0c 期望工资是20K xff0c 已经有三年工作经验了 xff0c 小编我也把这位小伙的项目COPY过来 xff0c 这
  • 使用Stratis在Linux中配置本地存储

    配置本地存储是台式机Linux用户很少执行的操作 在安装过程中可能只有一次 Linux存储技术发展缓慢 xff0c 如今20年前仍在使用许多存储工具 但是从那以后有些事情有所改善 人们为什么不利用这些新功能 xff1f 本文介绍Strati
  • 如何安装和配置OnlyOffice

    功能介绍 ONLYOFFICE是一款集成了文档 电子邮件 事件 任务和客户关系管理工具的开源在线办公套件 其文档管理功能实现了文档的在线编辑 在线预览和协同管理 xff0c 可用于替代Office365或Google docs 另外 xff
  • 初探Nacos(一)-- 单机模式启动

    花小钱 xff0c 周边游 xff0c 马上抢 xff0c 请关注公众号 xff1a 爱订不订 作者 xff1a 唐璜 前言 Nacos 支持基于 DNS 和基于 RPC 的服务发现 xff08 可以作为springcloud的注册中心 x
  • 筹码集中度90与70区别是什么?

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 筹码集中度是指一只个股的筹码被庄家掌握的程度 我们看到不同的数值 xff0c 比如说90和70 xff0c 很多的股民都不知道筹码集中度90与70区别是什么 下边小编会为大
  • Caused by: org.xml.sax.SAXParseException: 文件提前结束。

    Error starting ApplicationContext To display the auto configuration report re run your application with 39 debug 39 enab
  • AHB总线协议(一)

    1 简介 AHB Advanced High Performance Bus 总线规范是AMBA Advanced Microcontroller Bus Architecture V2 0总线规范的一部分 xff0c AMBA总线规范是A
  • iOS 4.5.5版本 被拒绝!!!! "App Rejected : non-public APIs"

    今天上午收到邮件说是被拒绝了 原文是 这一版本 我就添加一个购买sku的方法 并没有添加什么库 简简单单的一次升级给我出一私有方法拒绝 在xcode8 iOS10 刚出来 苹果新规则进一步丰富 出现这种意外的问题 一定不只我一个 的确 我在
  • 删除文件夹及其子文件

    rm rf 目录 转载于 https www cnblogs com tiandsp archive 2012 07 09 2583207 html
  • 树莓派练习程序(土壤湿度检测)

    土壤湿度检测模块如下 xff1a 树莓派的引脚如下图 xff1a 我们将Vcc引脚连接物理接口2 xff0c GND引脚连接物理接口39 xff0c DO引脚连接物理接口40 实物连接如下图 xff1a 编程使用WiringPi库 xff0
  • 搞定面试问题-进程、线程、协程

    关于进程 xff0c 线程 xff0c 协程是面试中经常可见的问题 xff0c 接下来这篇文章帮你梳理一下 xff0c 让你轻松应对面试官 1 xff0c 什么是进程 一个程序的执行实例就是一个进程 每一个进程提供执行程序所需的所有资源 x
  • OVN 架构分析

    架构分析Base flow L2 L3 forwardingOVN L2 gateway OVN 是 Open vSwitch 社区在 2015 年 1 月份才宣布的一个子项目 xff0c OVN 使用 Open vSwitch功能提供一个
  • fyi 在邮件里是什么意思_FYI的完整形式是什么?

    fyi 在邮件里是什么意思 仅供参考 xff1a 供您参考 FYI For Your Information FYI is an acronym of 34 For Your Information 34 It is a widesprea
  • Maven war包相互依赖

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 假设有两个war包 xff1a A和B A又依赖于B 根据Java规范 xff0c classpath不能指定WAR文件 这就意味着在编译时 xff0c A项目无法访问B项

随机推荐