CentOS 8–1905 กับ RHEL 8.0 เหมือนหรือต่างกัน?

Damrongsak Reetanon
2 min readOct 15, 2019

--

จากความคิดเดิม ความเคยชินเดิม ของความสัมพันธ์ระหว่า CentOS กับ RHEL ทำให้ผมปักหมุดความคิดตั้งแรกวันแรกว่า CentOS 8–1905 กับ RHEL 8.0 ต้องเหมือนกันเป็นฝาแฝดกัน แต่หลังจากใช้ CentOS 8 มาสักพัก เริ่มสงสัยว่า CentOS 8 ที่เพิ่งออก กับ RHEL 8 ต่างกัน ก็เลยหาคำตอบ

  1. ผม mount CentOS 8 iso ไว้ที่ ./c8 และ mount RHEL 8.0 ไว้ที่ ./r8
# mkdir c8 r8
# mount -o loop CentOS-8-x86_64-1905-dvd1.iso ./c8
mount: /dev/loop0 is write-protected, mounting read-only
# mount -o loop rhel-8.0-x86_64-dvd.iso ./r8
mount: /dev/loop1 is write-protected, mounting read-only

2. หา version และ release ของ .rpm เฉพาะ x86_64 ของทั้งสอง iso

##### CentOS 8 package information
# find ./c8 -name "*.x86_64.rpm" -exec rpm -qp --queryformat "%{NAME} %{VERSION} %{RELEASE}\n" {} \; 2>/dev/null > c8.txt
##### RHEL 8 package information
# find ./r8 -name "*.x86_64.rpm" -exec rpm -qp --queryformat "%{NAME} %{VERSION} %{RELEASE}\n" {} \; 2>/dev/null > r8.txt

3. เปรียเทียบ version, release และ package ที่มีใน CentOS แต่ไม่มีใน RHEL

]# cat compare.sh
#!/bin/bash
input='c8.txt'
while IFS= read -r line
do
PACKAGE=`echo $line |cut -d " " -f1`
CVERSION=`echo $line |cut -d " " -f2`
CRELEASE=`echo $line |cut -d " " -f3`
r8=`grep "^$PACKAGE " r8.txt`
RVERSION=`echo $r8 |cut -d " " -f2`
RRELEASE=`echo $r8 |cut -d " " -f3`
if [ "$CVERSION" != "$RVERSION" ]
then
if [ "$RVERSION" = "" ]
then
echo $PACKAGE" not found in RHEL 8" >> not_found_in_rhel.txt
else
echo $PACKAGE" centos = "$CVERSION": red hat = "$RVERSION >> diff_version.txt
fi
else
if [ "$CRELEASE" != "$RRELEASE" ]
then
echo $PACKAGE" centos = "$CRELEASE": red hat = "$RRELEASE >> diff_release.txt
fi
fi
done < "$input"

ผลที่ได้

1. สิ่งที่่มีใน CentOS แต่ไม่มีใน RHEL
https://pastebin.com/gY8xXNDs
2. version ต่างกัน
https://pastebin.com/HsvRmVbU
3. version เหมือนก้น แต่ release ต่างกัน
https://pastebin.com/S2yWYKwM

สุดท้าย

โดย ภาพรวมใหญ่ ๆ ดูไม่ต่างกัน version หลัก ๆ ไม่ต่างกันมาก แต่ release ค่อนข้างเปลี่ยนไปเยอะเหมือนกัน

### ผิดถูก แนะนำกันได้นะครับ ผมทำคร่าว ๆ ไม่ได้ลงรายละเอียดอะไรมาก ####

--

--

Damrongsak Reetanon
Damrongsak Reetanon

Written by Damrongsak Reetanon

OpenSource |Cloud Computing|Automation|DevOps

No responses yet