1. 程式人生 > >查看CentOS/Linux的版本信息

查看CentOS/Linux的版本信息

mysq 使用 extras plugins lsb car 內核 edi 選擇

今天在安裝MySql的時候,想選擇linux的版本對應的MySql。

1、查看內核版本和x86/x64版本

方法一、cat /proc/version

[root@sxl129 Desktop]# cat /proc/version
Linux version 2.6.32-431.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Fri Nov 22 03:15:09 UTC 2013

方法二、uname -a

1 ktop]# uname
-a 2 Linux sxl129 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

這裏顯示linux的內核版本是Red Hat 4.4.7-4,64位,

2、查看Linux內核版本

上面顯示的Red Hat 4.4.7-4是Ret Hat自己的版本號,因為它是來自於Red Hat Enterprise Linux依照開放源代碼規定發布的源代碼所編譯而成而這還不是Linux的內核版本。

我們可以使用lsb-reales -a命令來查看Linux的內核版本。

(1)、使用lsb-reales -a命令,但是顯示:bash: lsb_release: command not found

。需要安裝一下lsb。

1 [root@sxl129 Desktop]# lsb_release -a
2 bash: lsb_release: command not found

(2)、使用直接yum install -y lsb

1 [root@sxl129 Desktop]# yum install -y lsb
2 Loaded plugins: fastestmirror, refresh-packagekit, security
3 Loading mirror speeds from cached hostfile
4  * base: mirrors.cn99.com
5 * extras: mirrors.163.com 6 * updates: mirrors.163.com 7 Setting up Install Process 8 ....................................

(3)、查看linux內核版本

1 [root@sxl129 Desktop]# lsb_release -a
2 LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
3 Distributor ID:    CentOS
4 Description:    CentOS release 6.5 (Final)
5 Release:    6.5
6 Codename:    Final

至此,我們知道在選用MySql版本的時候,應該選用6.5版本&64位。

參考文檔:

http://blog.csdn.net/xiexievv/article/details/42238835

http://www.linuxidc.com/Linux/2016-05/131749.htm

http://blog.csdn.net/carolzhang8406/article/details/6080400

http://www.linuxidc.com/Linux/2014-12/110748.htm

查看CentOS/Linux的版本信息