首页 > 编程知识 正文

ubuntu查看ubuntu版本,ubuntu怎么查看版本信息

时间:2023-05-05 11:00:24 阅读:196631 作者:3452

cat /proc/version

推荐使用此方法获取Linux版本信息

查看显示内存中kernel相关的版本、编译等信息Ubuntu和CentOS通用,可以显示内核版本同时显示发行版本 sun@u20a:/root$ cat /proc/versionLinux version 5.4.0-77-generic (buildd@lgw01-amd64-028) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 [root@C8-186 ~]# cat /proc/versionLinux version 4.18.0-147.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Wed Dec 4 21:51:45 UTC 2019 uname -a uname命令用来查看系统信息,Ubuntu和CentOS通用只有内核版本,没有发行版本 sun@u20a:/root$ uname -aLinux u20a 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@C8-186 ~]# uname -aLinux C8-186 4.18.0-147.el8.x86_64 #1 SMP Wed Dec 4 21:51:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux uname详细信息 sun@u20a:/root$ whatis unameuname (1) - print system informationsun@u20a:/root$ uname --helpUsage: uname [OPTION]...Print certain system information. With no OPTION, same as -s. -a, --all print all information, in the following order, except omit -p and -i if unknown: -s, --kernel-name print the kernel name -n, --nodename print the network node hostname -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version -m, --machine print the machine hardware name -p, --processor print the processor type (non-portable) -i, --hardware-platform print the hardware platform (non-portable) -o, --operating-system print the operating system --help display this help and exit --version output version information and exit cat /etc/issue

不推荐,但是可以快速取到Ubuntu发行版本号

/etc/issue文件是Linux系统开机启动时在命令行界面弹出的欢迎语句文件Ubuntu中记录了发行版本名,但CentOS没有 sun@u20a:/root$ cat /etc/issueUbuntu 20.04.2 LTS n l [root@C8-186 ~]# cat /etc/issueSKernel r on an m lsb_release -a lsb_release:prints certain LSB (Linux Standard Base) and Distribution information.专门用来查看当前系统的发行版信息的命令Ubuntu默认已安装,但最小化安装CentOS没有安装 sun@u20a:/root$ lsb_release -aNo LSB modules are available.Distributor ID:UbuntuDescription:Ubuntu 20.04.2 LTSRelease:20.04Codename:focal CentOS需要额外安装软件包 [root@C8-186 ~]# lsb_release -a-bash: lsb_release: command not found[root@C8-186 ~]# yum -y install lsb_releaseBaseOS 31 kB/s | 3.9 kB 00:00 AppStream 37 kB/s | 4.3 kB 00:00 EPEL 32 kB/s | 4.7 kB 00:00 extras 12 kB/s | 1.5 kB 00:00 centosplus 12 kB/s | 1.5 kB 00:00 No match for argument: lsb_releaseError: Unable to find a match: lsb_release[root@C8-186 ~]# yum provides lsb_releaseLast metadata expiration check: 0:00:16 ago on Tue 13 Jul 2021 07:05:20 PM CST.redhat-lsb-core-4.1-47.el8.i686 : LSB Core module supportRepo : AppStreamMatched from:Filename : /usr/苹果小猫咪/lsb_releaseredhat-lsb-core-4.1-47.el8.x86_64 : LSB Core module supportRepo : AppStreamMatched from:Filename : /usr/苹果小猫咪/lsb_release[root@C8-186 ~]# yum -y install redhat-lsb-core-4.1-47.el8.x86_64#……省略的安装信息Installed: redhat-lsb-core-4.1-47.el8.x86_64 at-3.1.20-11.el8.x86_64 avahi-libs-0.7-20.el8.x86_64 cups-libs-1:2.2.6-38.el8.x86_64 ed-1.14.2-4.el8.x86_64 mailx-12.5-29.el8.x86_64 ncurses-compat-libs-6.1-7.20180224.el8.x86_64 patch-2.7.6-11.el8.x86_64 psmisc-23.1-5.el8.x86_64 spax-1.5.3-13.el8.x86_64 time-1.9-3.el8.x86_64 util-linux-user-2.32.1-27.el8.x86_64 cups-client-1:2.2.6-38.el8.x86_64 liblockfile-1.14-1.el8.x86_64 redhat-lsb-submod-security-4.1-47.el8.x86_64 esmtp-1.2-15.el8.x86_64 libesmtp-1.0.6-18.el8.x86_64 Complete![root@C8-186 ~]# lsb_release LSB Version::core-4.1-amd64:core-4.1-noarch[root@C8-186 ~]# lsb_release -aLSB Version::core-4.1-amd64:core-4.1-noarchDistributor ID:CentOSDescription:CentOS Linux release 8.1.1911 (Core) Release:8.1.1911Codename:Core

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。