如何检查Ubuntu版本

第一个地方,在/etc/issue文件中查看

$ cat /etc/issue
Ubuntu Xenial Xerus \n \l

/etc/lsb-release中可以查看版本号:

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu Xenial Xerus

有关Ubuntu版本的其他信息可以在/etc/os-release中找到:

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="16.04 (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial

使用lsb_release命令查看:

$ lsb_release -crid
Distributor ID:	Ubuntu
Description:	Ubuntu Xenial Xerus (development branch)
Release:	16.04
Codename:	xenial

systemd命令hostnamectl也可以显示Ubuntu版本以及内核版等信息:

$ hostnamectl
   Static hostname: onitroad
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 3b348a19c578436796b717d614b868b1
           Boot ID: 1ad07ee4476a466392fc8dfa423e3b11
  Operating System: Ubuntu 16.04
            Kernel: Linux 4.4.0-18-generic
      Architecture: x86-64
日期:2020-07-07 20:55:14 来源:oir作者:oir