การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`
ทำความเข้าใจการจัดการแพ็กเกจซอฟต์แวร์บนระบบที่ใช้ Red Hat ด้วย `yum`, `dnf` และ `rpm`
การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm` เป็นบทเรียน Linux Command Line Mastery ฟรีบน CoddyKit นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Linux Command Line Mastery และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Intro to Package Management
Welcome to package management on CentOS/Fedora! Software on Linux systems is often distributed in 'packages'.
A package manager helps you install, update, configure, and remove software packages, as well as manage their dependencies (other software they rely on).
On Red Hat-based systems like CentOS and Fedora, we primarily use three tools: rpm, yum, and dnf.
RPM: The Foundation
At its core, all Red Hat-based systems use the Red Hat Package Manager (RPM). Think of rpm as the low-level tool.
It directly handles .rpm files, which contain compiled software and metadata. However, rpm doesn't automatically resolve dependencies.
- Install:
rpm -i package.rpm - Query:
rpm -q package_name - Remove:
rpm -e package_name
Querying Packages with RPM
Let's see how to query information about an installed package using rpm. The -q flag is for querying.
rpm -q bash checks if the 'bash' shell is installed. rpm -qi bash gives more detailed information.
rpm -q bash
rpm -qi bashYUM: Solving Dependencies
Manually managing dependencies with rpm can be tedious. This is where YUM (Yellowdog Updater, Modified) came in.
yum is a higher-level tool built on top of rpm. It automatically searches repositories, resolves dependencies, and installs all necessary packages.
For many years, yum was the standard package manager for CentOS and older Fedora versions.
Installing Software with YUM
Using yum is much simpler for everyday tasks. To install a package, you just need its name.
Let's try installing a simple text editor like nano. You'll often need sudo for installation commands.
sudo yum install nanoUpdating & Removing with YUM
yum makes it easy to keep your system updated and manage installed software.
- Update all:
sudo yum update - Update specific:
sudo yum update package_name - Remove:
sudo yum remove package_name - Search:
yum search keyword
These commands handle all dependencies for you!
DNF: The Modern Standard
DNF (Dandified YUM) is the next-generation package manager, now standard in modern Fedora and CentOS Stream/8+.
It's an improved version of yum, offering better performance, more robust dependency resolution, and a cleaner codebase.
The good news? Most yum commands work almost identically with dnf!
DNF Basic Operations
Let's see dnf in action. Its syntax is very similar to yum.
We can use dnf to list available or installed packages, or to install new ones. Try listing all installed packages that include 'nano' in their name.
sudo dnf install nano
dnf list installed | grep nanoManaging Software Groups with DNF
One powerful feature of dnf (and yum) is the ability to manage software groups. These are collections of related packages for common tasks.
For example, you can install a 'Development Tools' group which includes compilers, debuggers, and other utilities.
dnf group listPackage Manager Quiz
Test your knowledge on CentOS/Fedora package managers!
Recap: CentOS/Fedora PM
You've explored the essential package managers for CentOS/Fedora:
rpm: The low-level foundation, handles individual.rpmfiles.yum: The classic high-level manager, resolves dependencies automatically.dnf: The modern, faster, and more robust successor toyum.
Mastering these tools is key to managing software effectively on Red Hat-based Linux systems. Keep practicing!
คำถามที่พบบ่อย
บทเรียน “การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Linux Command Line Mastery ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`”
ทำความเข้าใจการจัดการแพ็กเกจซอฟต์แวร์บนระบบที่ใช้ Red Hat ด้วย `yum`, `dnf` และ `rpm` คุณปฏิบัติ Linux Command Line Mastery ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Linux Command Line Mastery หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Linux Command Line Mastery บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน
บทเรียน “การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Linux Command Line Mastery นี้ได้ไหม
ได้ บทเรียน Linux Command Line Mastery ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- การจัดเก็บและบีบอัดไฟล์: `tar`, `gzip`, `bzip2`
- การจัดการแพ็กเกจ (Debian/Ubuntu): `apt`, `dpkg`
- การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`
- การสร้างจากซอร์ส: configure, make และ make install