0
0
Linux CLIscripting~10 mins

yum/dnf (RHEL/CentOS) basics in Linux CLI - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - yum/dnf (RHEL/CentOS) basics
Start: User wants to manage packages
Choose command: yum or dnf
Run command with options
System checks repositories
Download package info or packages
Install/Update/Remove packages
Show success or error message
End
This flow shows how yum or dnf commands manage software packages by checking repos, downloading, and installing or removing them.
Execution Sample
Linux CLI
sudo dnf install nano
sudo dnf update
sudo dnf remove nano
These commands install, update, and remove the nano text editor using dnf.
Execution Table
StepCommandActionSystem ResponseOutput Example
1sudo dnf install nanoCheck repos for nano packageFound nano in repoDependencies resolved
2sudo dnf install nanoDownload nano packageDownloading packagesDownloading nano-5.9-1.el8.x86_64.rpm
3sudo dnf install nanoInstall nano packageInstalling packagesInstalled: nano-5.9-1.el8.x86_64
4sudo dnf updateCheck for updatesChecking for updatesNo packages marked for update
5sudo dnf remove nanoCheck installed packagesnano is installedDependencies resolved
6sudo dnf remove nanoRemove nano packageRemoving packagesRemoved: nano-5.9-1.el8.x86_64
7sudo dnf remove nanoConfirm removalnano no longer installedComplete!
8End of commands
💡 Commands finish after installing, updating, or removing packages with success or no changes.
Variable Tracker
VariableStartAfter Step 1After Step 3After Step 4After Step 6Final
nano_package_statusnot installedfound in repoinstalledinstalledremovednot installed
update_statusunknownunknownunknownno updatesno updatesno updates
Key Moments - 3 Insights
Why does the system check repositories before installing?
The system checks repositories to find the package and its dependencies before downloading, as shown in execution_table rows 1 and 2.
What happens if no updates are available when running 'dnf update'?
The system reports 'No packages marked for update' and stops, as seen in execution_table row 4.
Why must we use 'sudo' with yum/dnf commands?
Because installing or removing software needs admin rights, so 'sudo' runs the command with those rights.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the nano package status after step 3?
Afound in repo
Binstalled
Cnot installed
Dremoved
💡 Hint
Check variable_tracker column 'After Step 3' for nano_package_status.
At which step does the system confirm no updates are available?
AStep 2
BStep 6
CStep 4
DStep 1
💡 Hint
Look at execution_table row with 'sudo dnf update' command.
If you remove 'sudo' from the commands, what likely happens?
ACommands fail due to permission denied
BCommands run successfully
CPackages install without confirmation
DSystem updates automatically
💡 Hint
Refer to key_moments about why 'sudo' is needed.
Concept Snapshot
yum/dnf basics:
- Use 'sudo dnf install package' to install software
- Use 'sudo dnf update' to update all packages
- Use 'sudo dnf remove package' to uninstall
- System checks repos, downloads packages, installs/removes
- 'sudo' needed for admin rights
- Output shows progress and success or errors
Full Transcript
This lesson shows how to use yum or dnf commands on RHEL/CentOS to manage software packages. The commands check repositories for packages, download them, and install or remove them. Using 'sudo' is important because these actions need administrator rights. The execution table traces installing the nano editor, updating packages, and removing nano, showing system responses at each step. Variables track the package status and update status through the process. Key moments clarify why repos are checked first, what happens if no updates exist, and why 'sudo' is required. The quiz tests understanding of package status after installation, update checking, and permission needs. The snapshot summarizes the main commands and their behavior for quick reference.