Ubuntu
查看 CPU
架构、系统信息、内核版本、版本代号等相关信息有很多方式,本文介绍几种常用的命令。
x86
架构与 ARM
架构的 CPU
架构不同,如果回显为 aarch64
表示为 ARM
架构,如果回显为 x86_64
表示为 x86
架构,参考《CPU 架构(x86/ARM)简介》这篇文章。
uname
root@k8s-master:~# unameLinuxroot@k8s-master:~# uname -aLinux k8s-master 5.15.0-1027-raspi #29-Ubuntu SMP PREEMPT Mon Apr 3 10:12:21 UTC 2023 aarch64 aarch64 aarch64 GNU/Linuxroot@k8s-master:~# uname -r5.15.0-1027-raspiroot@k8s-master:~# uname -maarch64
arch
root@k8s-master:~# archaarch64
Ubuntu
基础版本号由日期组成,比如 Ubuntu 22.04
表示 2022 年 4 月份发布的版本,在选择 Ubuntu
版本的时候,最好选择 LTS(Long Term Support)
版本,而且每个 Ubuntu
版本都有一个代号,这个代号会在安装软件时用到。
Ubuntu LTS
各版本代号如下:
- Ubuntu 12.04 (LTS)代号为 precise
- Ubuntu 14.04 (LTS)代号为 trusty
- Ubuntu 16.04 (LTS)代号为 xenial
- Ubuntu 18.04 (LTS)代号为 bionic
- Ubuntu 20.04 (LTS)代号为 focal
- Ubuntu 22.04 (LTS)代号为 jammy
lsb_release
root@k8s-master:~# lsb_release -aNo LSB modules are available.Distributor ID:UbuntuDescription:Ubuntu 22.04.2 LTSRelease:22.04Codename:jammyroot@k8s-master:~# lsb_release -cCodename:jammy
lscpu
root@k8s-master:~# lscpuArchitecture:aarch64CPU op-mode(s):32-bit, 64-bitByte Order:Little EndianCPU(s):4On-line CPU(s) list: 0-3Vendor ID: ARMModel name:Cortex-A72Model: 3Thread(s) per core:1Core(s) per cluster: 4Socket(s): -Cluster(s):1Stepping:r0p3CPU max MHz: 1800.0000CPU min MHz: 600.0000BogoMIPS:108.00Flags: fp asimd evtstrm crc32 cpuidCaches (sum of all): L1d: 128 KiB (4 instances)L1i: 192 KiB (4 instances)L2:1 MiB (1 instance)Vulnerabilities: Itlb multihit: Not affectedL1tf:Not affectedMds: Not affectedMeltdown:Not affectedMmio stale data: Not affectedRetbleed:Not affectedSpec store bypass: VulnerableSpectre v1:Mitigation; __user pointer sanitizationSpectre v2:VulnerableSrbds: Not affectedTsx async abort: Not affected
/proc/version
root@k8s-master:~# cat /proc/versionLinux version 5.15.0-1027-raspi (buildd@bos02-arm64-011) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #29-Ubuntu SMP PREEMPT Mon Apr 3 10:12:21 UTC 2023