Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm`
Entenda como gerenciar pacotes de software em sistemas baseados em Red Hat com `yum`, `dnf` e `rpm`.
Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm` é uma aula grátis de Linux Command Line Mastery no CoddyKit. Esta é a aula 3 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Linux Command Line Mastery, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Linux Command Line Mastery inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
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!
Perguntas Frequentes
A aula “Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm`” é grátis?
Sim — o texto completo de “Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm`” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Linux Command Line Mastery, atualize para CoddyKit PRO. O curso de Linux Command Line Mastery inclui 4 aulas no total.
O que vou aprender em “Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm`”?
Entenda como gerenciar pacotes de software em sistemas baseados em Red Hat com `yum`, `dnf` e `rpm`. Você pratica Linux Command Line Mastery com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Linux Command Line Mastery?
Nenhuma experiência prévia é necessária. Linux Command Line Mastery no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 3 de 4.
Quanto tempo leva a aula “Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm`”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Linux Command Line Mastery?
Sim. Cada aula de Linux Command Line Mastery inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Arquivamento e compactação: `tar`, `gzip`, `bzip2`
- Gerenciamento de pacotes (Debian/Ubuntu): `apt`, `dpkg`
- Gerenciamento de pacotes (CentOS/Fedora): `yum`, `dnf`, `rpm`
- Compilando a partir do Código-Fonte: configure, make e make install