Recognizing distribution differences
On this page
You find instructions for a tool you need, but they begin with dnf instead of apt. Replacing the command name blindly can select the wrong package or change more than you intended.
By the end, you can identify the package-management family an instruction assumes, translate its task, and recognize when an application belongs to a separate packaging system.
Before you start
Section titled “Before you start”Finish Understanding update terminology. Use the B04 lab directory for read-only Ubuntu queries. No installation or reset is needed here.
The capture lab is Ubuntu only. It has no dnf, rpm, snap, or flatpak. The tables below are static documentation references, not captured executions or instructions to install those managers in this container. A RHEL-family lab belongs to the later course sequence.
Identify the family before translating the task
Section titled “Identify the family before translating the task”Ubuntu uses Debian-format .deb packages. APT selects packages from configured repositories and resolves dependencies; dpkg handles package installation records and lower-level operations. RHEL-family distributions use .rpm packages, with DNF for repository operations and RPM for lower-level package work and database queries.
Those roles are useful counterparts, but neither package names nor options are interchangeable between distributions. A program may be split into different packages, require a different repository, or be unavailable for a particular release. Check the distribution, release, and installed tool’s manual before choosing a command.
Here is the APT side of the comparison. PACKAGE means a verified package name from your distribution, and TERM means a search term. They are placeholders, not literal package names.
| Task | APT reference |
|---|---|
| Search descriptions and names | apt search TERM |
| Inspect offered metadata | apt show PACKAGE |
| Refresh repository information | sudo apt update |
| Review installation without accepting | sudo apt install --assume-no PACKAGE |
| Install after reviewing the plan | sudo apt install PACKAGE |
| Upgrade installed packages after review | sudo apt upgrade |
| Remove a selected package after review | sudo apt remove PACKAGE |
The matching DNF tasks use their own vocabulary. These examples refer to DNF’s documented command interface; distributions can ship different DNF generations and defaults.
| Task | DNF reference; not executed here |
|---|---|
| Search descriptions and names | dnf search TERM |
| Inspect package information | dnf info PACKAGE |
| Refresh and build metadata cache | sudo dnf makecache --refresh |
| Review installation without accepting | sudo dnf --assumeno install PACKAGE |
| Install after reviewing the plan | sudo dnf install PACKAGE |
| Upgrade installed packages after review | sudo dnf upgrade |
| Remove a selected package after review | sudo dnf remove PACKAGE |
Read the task row rather than matching words mechanically. DNF can refresh expired metadata during other operations. Its update is an alias for upgrade, which changes packages; it does not mean APT’s index-only update. Removal behavior and dependency cleanup also differ. Inspect the full transaction plan, including dependencies, instead of assuming the APT plan’s shape.
Ask the installed database about files
Section titled “Ask the installed database about files”Repository search answers what software a configured source offers. File-ownership queries answer which installed package supplied a path. The query needs an actual installed file, not a program name guessed from a tutorial.
| Debian/Ubuntu query task | Command |
|---|---|
| Find a file’s owning package | dpkg -S /usr/bin/apt |
| List an installed package’s paths | dpkg -L apt |
| RPM query task | Reference; not executed here |
|---|---|
| Find a file’s owning package | rpm -qf /path/to/file |
| List an installed package’s paths | rpm -ql PACKAGE |
Replace /path/to/file with a real path on the RPM-based machine. Do not use /usr/bin/apt as though it were guaranteed to exist there. Similarly, apt in the Debian table is an installed package name in this lab, not an RPM package-name recommendation.
Run the real Ubuntu-side example:
command -v dnf rpm snap flatpakdpkg -S /usr/bin/aptdpkg -L apt | head -n 12Predict first: does an empty result from the first command mean that software installation is unavailable on this system?
Run it, then compare with your guess
learner@rootvolt:~/lab$ command -v dnf rpm snap flatpaklearner@rootvolt:~/lab$ dpkg -S /usr/bin/aptapt: /usr/bin/aptlearner@rootvolt:~/lab$ dpkg -L apt | head -n 12/.
/etc
/etc/apt
/etc/apt/apt.conf.d
/etc/apt/apt.conf.d/01-vendor-ubuntu
/etc/apt/apt.conf.d/01autoremove
/etc/apt/auth.conf.d
/etc/apt/keyrings
/etc/apt/preferences.d
/etc/apt/sources.list.d
/etc/apt/trusted.gpg.d
/etc/cron.dailylearner@rootvolt:~/lab$ Steps (8)
- Type
command -v dnf rpm snap flatpak - Press Enter
- Type
dpkg -S /usr/bin/apt - Press Enter
- Output:
apt: /usr/bin/apt - Type
dpkg -L apt | head -n 12 - Press Enter
- Output:
/. /etc /etc/apt /etc/apt/apt.conf.d /etc/apt/apt.conf.d/01-vendor-ubuntu /etc/apt/apt.conf.d/01autoremove /etc/apt/auth.conf.d /etc/apt/keyrings /etc/apt/preferences.d /etc/apt/sources.list.d /etc/apt/trusted.gpg.d /etc/cron.daily
No. None of those four names resolves in this shell, but Ubuntu’s own package tools are present. The first command prints nothing and returns status 1. The ownership query identifies package apt. The last command limits the package path listing to twelve lines; it is not the complete list.
The package listing includes directories as well as files. It describes registered paths, not a live recursive scan of everything inside each directory. Keep B10’s distinction between database records and filesystem searches.
Recognize a separate application package system
Section titled “Recognize a separate application package system”An application can also be distributed outside the system’s native package database. Flatpak and Snap provide separate packaging and update mechanisms. Installing their supporting tools through a system package manager does not make every application they manage an APT or RPM package.
| Packaging system | Scope and boundary |
|---|---|
Native .deb or .rpm packages |
Integrate software with the distribution’s system package records and dependencies. This includes core libraries and system administration tools. |
| Flatpak | Commonly distributes desktop applications using applications, shared runtimes, and configured remotes. A runtime supplies a shared execution environment. Sandbox permissions and portals control access beyond it. |
| Snap | Distributes applications and services using snaps managed by snapd, with channels and refresh behavior of its own. Access depends on confinement and connected interfaces; classic confinement permits broader host access. |
These boundaries affect troubleshooting. If the system package manager does not list a particular application, establish how it was installed before concluding it is missing. Two installations with the same displayed application name can have different versions, data locations, or permissions because different systems manage them.
Neither Flatpak nor Snap means “safe regardless of publisher.” Sandboxing restricts an application’s access to host resources, but the effective permissions matter. An application granted broad file access can still use that access. Repository or store identity, publisher trust, and granted permissions remain separate questions.
This lab does not demonstrate either runtime. Containers usually lack the desktop and service environment those workflows need. Installing them here solely to reproduce a table would not establish normal desktop behavior.
Mistakes to recognize
Section titled “Mistakes to recognize”Treating a missing manager as a typo in apt. Check the tutorial’s target distribution. An RPM instruction may be correct for its intended system and unsuitable for this Ubuntu lab.
Copying package names across families. Translate the task, search the target distribution’s sources, then inspect the offered package. Equivalent software does not establish identical package names or options.
Checking only APT for a separately packaged application. Identify its actual installation mechanism before choosing its update or removal tool. Do not remove a similarly named native dependency hoping it will remove the application.
Try it yourself
Section titled “Try it yourself”Goal: A RHEL-family instruction asks you to find the package owning an existing executable, then list that package’s files. Describe the two RPM queries and their Ubuntu counterparts. Explain why neither query should refresh repositories.
Hint
One query starts with a path. The other starts with the package name returned by the first.
Solution
Use rpm -qf /path/to/file, then rpm -ql PACKAGE on the RPM-based system. On Ubuntu use dpkg -S /path/to/file, then dpkg -L PACKAGE. Substitute actual paths and names on each machine. These inspect installed package records, so repository metadata refresh is a different operation. The real Ubuntu capture above verifies that side of the comparison; no RPM output is claimed.
- Identify the distribution and package-management family before translating commands.
- Match tasks across APT and DNF; verify names, options, and transaction plans independently.
- Dpkg and RPM can query installed package file ownership and file lists.
- Flatpak and Snap manage separate application packages with their own sources, updates, and access boundaries.
Next, Practice: Installing Software audits a temporary installation and proves its reset.
Further reading
Section titled “Further reading”- On Ubuntu:
man dpkgandman dpkg-query. On a DNF/RPM system, consult its installedman dnfandman rpm. - DNF command reference and RPM query reference.
- Flatpak: Basic concepts and sandbox permissions.
- Snap: Confinement.