Seberapa pentingkah mengetahui versi CentOS yang berjalan di server? Sangat penting, karena untuk instalasi aplikasi kita harus tahu apakah aplikasi tersebut dapat berjalan pada versi CentOS yang digunakan. Memakai repository yang sesuai dengan versi CentOS, dan bila ada perbaikan bug atau patch security. Berikut ini beberapa cara mengetahui versi CentOS yang digunakan:
*Mengetahui versi Linux Kernel*
Perintah /uname/
[INPUT]1 2 3 uname -or 3.10.0-862.3.3.el7.x86_64 GNU/Linux
*Mengetahui versi CentOS*
-Perintah /rpm/-
[INPUT]1 2 3 rpm –query centos-release centos-release-7-5.1804.el7.centos.2.x86_64
-Perintah /hostnamectl/-
[INPUT]1 2 3 4 5 6 7 8 9 10 11 12 hostnamectl Static hostname: centos-server Icon name: computer-vm Chassis: vm Machine ID: a8818327b9009a1f11efda7f3b858f98 Boot ID: fdb790cf2dce42288035c45c8d0b9877 Virtualization: kvm Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-862.3.3.el7.x86_64 Architecture: x86-64
-Perintah lsb_release-
Install paket /redhat-lsb/
[INPUT]1 sudo yum install redhat-lsb
Perintah cek versi
[INPUT]1 2 3 lsb_release -d Description: CentOS Linux release 7.5.1804 (Core)
-Menggunakan distro release file-
File /centos-release/
[INPUT]1 2 3 cat /etc/centos-release CentOS Linux release 7.5.1804 (Core)
File /system-release/
[INPUT]1 2 3 cat /etc/system-release CentOS Linux release 7.5.1804 (Core)
File /os-release/
[INPUT]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 cat /etc/os-release NAME=”CentOS Linux” VERSION=”7 (Core)” ID=”centos” ID_LIKE=”rhel fedora” VERSION_ID=”7″ PRETTY_NAME=”CentOS Linux 7 (Core)” ANSI_COLOR=”0;31″ CPE_NAME=”cpe:/o:centos:centos:7″ HOME_URL=”https://www.centos.org/” BUG_REPORT_URL=”https://bugs.centos.org/” CENTOS_MANTISBT_PROJECT=”CentOS-7″ CENTOS_MANTISBT_PROJECT_VERSION=”7″ REDHAT_SUPPORT_PRODUCT=”centos” REDHAT_SUPPORT_PRODUCT_VERSION=”7″
Selamat mencoba ð