如何查看当前 Debian 系统的版本 您所在的位置:网站首页 debian系统查看版本命令 如何查看当前 Debian 系统的版本

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

2024-05-08 07:13| 来源: 网络整理| 查看: 265

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

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

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

joseph@debian:~$ cat /etc/debian_version 9.9

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

joseph@debian:~$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

笔者常用的查看版本信息的命令是 lsb_release ,系统默认可能没有这个软件包。使用前,需要先安装,命令如下;

# apt-get install lsb-release

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

joseph@debian:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.9 (stretch) Release: 9.9 Codename: stretch

Systemd 中附带的命令 hostnamectl 也可以用来查看版本信息,样例;

joseph@debian:~$ hostnamectl Static hostname: debian Icon name: computer-vm Chassis: vm Machine ID: ec27d3592320f9a20f18f50f332019b1 Boot ID: 82975e6427c048f888e0a170f6d78813 Virtualization: kvm Operating System: Debian GNU/Linux 9 (stretch) Kernel: Linux 4.9.0-9-amd64 Architecture: x86-64


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有