介绍一下常用的几种查看 Debian 版本号的方法
查看”/etc/issue”文件
最简单的方法是查看/etc/issue
这个文件
1 2
| # cat /etc/issue Debian GNU/Linux 9 \n \l
|
如果还想知道 Debian 的小版本号,需要如下命令
1 2
| # cat /etc/debian_version 9.4
|
查看”/etc/os-release”文件
如果想查看更详细的版本信息
1 2 3 4 5 6 7 8 9
| # 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 命令
系统默认可能不支持lsb_release
命令,需要手动安装一下
1
| # apt-get install lsb-release
|
然后通过如下命令查看
1 2 3 4 5 6
| # lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.4 (stretch) Release: 9.4 Codename: stretch
|