パッケージ管理(CentOS/Fedora):`yum`、`dnf`、`rpm`
`yum`、`dnf`、`rpm`を使って、Red Hat系システムのソフトウェアパッケージを管理する方法を理解します。
「パッケージ管理(CentOS/Fedora):`yum`、`dnf`、`rpm`」はCoddyKit上の無料Linux Command Line Masteryレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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`」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Linux Command Line Masteryコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Linux Command Line Masteryコースには全4レッスンが含まれています。
「パッケージ管理(CentOS/Fedora):`yum`、`dnf`、`rpm`」で何を学びますか?
`yum`、`dnf`、`rpm`を使って、Red Hat系システムのソフトウェアパッケージを管理する方法を理解します。 ブラウザで直接実行するハンズオンコードでLinux Command Line Masteryを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Linux Command Line Masteryを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのLinux Command Line Masteryは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン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