查詢 Ubuntu 版本

要查詢安裝在電腦的 Ubuntu 版本有幾種方法,以下是查詢的方法。

1. /etc/lsb-release 檔案:

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

2. lsb_release 指令:

# lsb_release -da
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04
Codename: xenial

3. /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

4. /etc/issue 檔案

可以在 /etc/issue 看到 Ubuntu 版本,但只會有版本名稱:

# cat /etc/issue
Ubuntu Xenial Xerus




Leave a Reply