Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm`
Comprenda come gestire i pacchetti software sui sistemi basati su Red Hat con `yum`, `dnf` e `rpm`.
Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm` è una lezione Linux Command Line Mastery gratuita su CoddyKit. Questa è la lezione 3 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Linux Command Line Mastery, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Linux Command Line Mastery include 4 lezioni in totale.
Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.
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!
Domande Frequenti
La lezione «Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm`» è gratuita?
Sì — il testo completo di «Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm`» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Linux Command Line Mastery, passa a CoddyKit PRO. Il corso Linux Command Line Mastery include 4 lezioni in totale.
Cosa imparerò in «Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm`»?
Comprenda come gestire i pacchetti software sui sistemi basati su Red Hat con `yum`, `dnf` e `rpm`. Eserciti Linux Command Line Mastery con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.
Ho bisogno di esperienza per iniziare Linux Command Line Mastery?
Non è richiesta alcuna esperienza precedente. Linux Command Line Mastery su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 3 di 4.
Quanto tempo richiede la lezione «Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm`»?
La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.
Posso scrivere ed eseguire codice in questa lezione Linux Command Line Mastery?
Sì. Ogni lezione Linux Command Line Mastery include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.
Tutte le lezioni di questo corso
- Archiviazione e compressione: `tar`, `gzip`, `bzip2`
- Gestione dei pacchetti (Debian/Ubuntu): `apt`, `dpkg`
- Gestione dei pacchetti (CentOS/Fedora): `yum`, `dnf`, `rpm`
- Compilare dal codice sorgente: configure, make e make install