查看centos版本方法


查看centos版本方法
 
1.
CentOS是RedHat Linux的社区发行版本,以下方法适用
 
[root @www ~]# cat /etc/redhat-release
CentOS release 5.2 (Final)
 
/etc/redhat-release配置文件用一行内容来声明 Red Hat 的名称和版本号。 由 rc.local 使用.
 
 
2.
查看rpm包版本
[root @www ~]# rpm -q centos-release
centos-release-5-2.el5.centos
 
如果是redhat,用这个 rpm -q redhat-release
 
3.
所有版本都可以用以下命令查看
lsb_release -a 适用于CentOS、RedHat、Ubuntu等等。
LSB是Linux Standard Base的缩写,lsb_release命令用来显示LSB和特定版本的相关信息。
 
-a, –all
就是显示所有信息,显示包括版本信息、发行版的ID、发行版的描述信息、具体版本号、发行版代号的信息。
具体可以用lsb_release -h查看帮助。
 
[root @www ~]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.2 (Final)
Release: 5.2
Codename: Final
 
4.
使用uname命令也可以查看发行版本号
[root @www ~]# uname -r
2.6.18-92.el5
 
[root @www ~]# uname -a
Linux www 2.6.18-92.el5 #1 SMP Tue Jun 10 18:49:47 EDT 2008 i686 athlon i386 GNU/Linux
 

相关内容

    暂无相关文章