如何查看当前 Debian 系统的版本

次浏览

摘要:有多种方式查看当前 Debian系统 的版本信息,这里我们会分别介绍。最简单的查看方法,是查看 /etc/issue 这个文件,样例如下

...

debian-logo-1024x576.png

有多种方式查看当前 Debian系统 的版本信息,这里我们会分别介绍。最简单的查看方法,是查看 /etc/issue 这个文件,样例如下;

root@debian:~# cat /etc/issue
Debian GNU/Linux 10 \n \l

上面的命令有个小问题,它没有显示 Debian 的小版本号。要获取 Debian 的小版本号 Point Release 信息,我们可以使用以下这几个命令。

root@debian:/# cat /etc/debian_version
10.8

/etc/debian_version 提供了完整的版本信息。另一个文件,则会提供更详细的版本信息,文件名是 /etc/os-release,样例如下;

root@debian:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

笔者常用的查看版本信息的命令是 lsb_release ,系统默认可能没有这个软件包。

使用前,需要先安装,命令如下;

root@debian:/# apt-get install lsb-release -y

lsb_release 命令的输出样例为如下,

root@debian:/# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

Systemd 中附带的命令 hostnamectl 也可以用来查看版本信息。

样例:

root@debian:/# hostnamectl
   Static hostname: debian
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 68261d32228a426e9d31e4118370df40
           Boot ID: 186e82e12be84d26919bdc390e9e13ad
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-14-amd64
      Architecture: x86-64

 

特别提醒:

  • 本文内容转载自其他媒体或网站平台,目的在于分享及传递更多信息,并不代表本网赞同其观点。
  • 其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。
  • 本站不承担此类作品侵权行为的直接责任及连带责任。
  • 如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。

本文来源:【Debian中国

---------------------------------- THE END ----------------------------------

随机新闻