yum and apt
100%

Packages · Lesson 6

yum and apt

Learn the repository-aware APT and DNF workflows for inspecting, installing, removing, and upgrading packages.

Repository-aware package managers retrieve metadata, solve dependencies, verify authenticated content, and coordinate transactions. Debian-family systems commonly use APT. Current Fedora and Red Hat Enterprise Linux releases use DNF; on current RHEL, the yum command remains as a compatibility alias for DNF, while older systems used the original YUM implementation.

Always follow the documentation for the installed distribution and release rather than assuming one command set applies everywhere.

Refreshing and Inspecting Metadata

APT separates metadata refresh from package upgrades:

Debian family: $ sudo apt update

Search and inspect before installation:

Debian family: $ apt search package-name
Debian family: $ apt show package-name
RPM family:    $ dnf search package-name
RPM family:    $ dnf info package-name

Repository configuration determines what these commands can discover. Read source names, architectures, versions, and signing errors carefully.

Which command displays APT package details for package-name?

Installing Packages

Install by repository package name with:

Debian family: $ sudo apt install package-name
RPM family:    $ sudo dnf install package-name

The manager proposes dependencies and any conflicts or replacements. Do not confirm automatically until you have reviewed package origin, version, architecture, download size, disk change, removals, and newly installed dependencies.

Which current command installs package-name from configured RPM-family repositories?

Removing Packages

Request removal with:

Debian family: $ sudo apt remove package-name
RPM family:    $ sudo dnf remove package-name

Removal can affect dependent packages or leave now-unused dependencies and configuration. Review the proposed transaction, distinguish remove from purge semantics on Debian-family systems, and preserve application data according to its own backup and retention procedure. Package removal does not promise to delete user-created data.

Why should you review a removal transaction before confirming it?

Applying Updates

On an APT system, refresh metadata and then review upgrades as separate successful steps:

$ sudo apt update
$ apt list --upgradable
$ sudo apt upgrade

On a DNF system, inspect and apply available updates with the locally documented workflow:

$ dnf check-update
$ sudo dnf upgrade

An update command can change core libraries, services, kernels, and dependencies. Use backups, maintenance policy, release notes, and restart or reboot planning appropriate to the system. Check command exit semantics: for example, some “check update” operations use a nonzero status to report that updates are available rather than an execution failure.

What is the relationship between apt update and apt upgrade?

Choosing `dnf` or `yum`

Use dnf in current Fedora and RHEL documentation. A yum command on a recent RHEL system can invoke DNF compatibility behavior, but scripts should not infer the implementation from the executable name alone. On legacy hosts, verify the installed version and supported syntax before translating instructions.

What does yum commonly represent on a current RHEL system?

Lesson complete

You finished yum and apt

You can now choose and review common repository package operations.

  • Use APT on Debian-family systems and DNF on current RPM-family systems.

  • Inspect metadata and proposed dependency changes before installation.

  • Treat removal as a dependency-aware transaction, not a single-file deletion.

  • Separate metadata refresh from upgrade application where the tool does.

  • Verify whether yum is legacy YUM or a DNF compatibility command.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Packages