Ubuntu OSのバージョンの確認

ubuntuのOSバージョンの確認方法を記述してます。方法は幾つか存在しますが、os-releaseを確認するのが一番簡単かと思われます。
os-releaseを確認
etcにある「os-release」にはOSの情報が記述されており、そちらをcatで確認します。
cat /etc/os-release
<出力結果>
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu Focal Fossa (development branch)"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
lsb-releaseを確認
ディストリビューション情報を確認します。
cat /etc/lsb-release
<出力結果>
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu Focal Fossa (development branch)"
lsb_releaseコマンドを実行すると「lsb_release」を参照できます。
lsb_release -a
<出力結果>
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04
Codename: focal
lsb_releaseコマンドが実行できない場合はインストールして下さい。
sudo apt install lsb-release
ちなみに32bitか64bitかを調べる場合は下記のコマンドで可能です。
arch
<出力結果>
x86_64
-
前の記事
FerenOS ssh接続を可能に設定する 2020.04.03
-
次の記事
CentOs7にWEBのサーバ管理ツール「Cockpit」をインストールしてdockerコンテナを管理する 2020.04.03
コメントを書く