LPIC-1 lab: Debian and RPM package families
Objectives 102.4 and 102.5 examine Debian and RPM package management separately, and both appear on the 101 paper. This guide asks each family the same three ordinary questions - what tools do you have, which package owns this file, what does that package contain - and is specific about where the two answers differ in shape, in wording and in the package name itself.
Start Here Guide 2 of 33 Beginner
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- TimeAbout 15 min
- RPM packagingrpm 4.19.1.1, dnf 4.20.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC1-A01 | 192.168.0.76 | Ubuntu 26.04 LTS | Debian-family host - dpkg and apt, which objective 102.4 names | 2 Core | 4 GB | 50 GB |
| LPIC1-B01 | 192.168.0.77 | AlmaLinux 10.2 | RPM-family host - rpm and dnf, which objective 102.5 names | 2 Core | 4 GB | 50 GB |
This guide includes
Use this before the packaging objectives. This matters because 102.4 and 102.5 examine Debian and RPM separately - the same question has two answers, and both are examinable.
- learning which tools each objective names
- asking which package owns a file, on each family
- listing what that package contains, both ways
Before you start
- what-lpic-1-asks
-
The tools each objective names
102.4 names one pair, 102.5 names the other. Both pairs are examined.
bash Example session dpkg --version | head -1; apt --version; echo "--- objective 102.4 names these"Debian 'dpkg' package management program version 1.23.7 (amd64).apt 3.2.0 (amd64)--- objective 102.4 names theserpm --version; dnf --version | head -1; echo "--- objective 102.5 names these"RPM version 4.19.1.14.20.0--- objective 102.5 names theseExpected resultdpkg 1.23.7 with apt 3.2.0, and rpm 4.19.1.1 with dnf 4.20.0.
Success conditionYou have both toolchains in front of you and know which layer each sits in.
-
The same question, asked twice
Which package owns a file - on each family.
bash Example session dpkg -S /usr/bin/sshopenssh-client: /usr/bin/sshrpm -qf /usr/bin/sshopenssh-clients-9.9p1-23.el10_2.alma.1.x86_64Expected result
openssh-client: /usr/bin/sshon Debian, and the full NEVRAopenssh-clients-9.9p1-23.el10_2.alma.1.x86_64on RPM.Success conditionYou can answer an ownership question on either family.
-
What that package contains
The listing question, both ways - and they do not line up.
bash Example session echo "what does that package contain?"; dpkg -L openssh-client | head -6what does that package contain?/./etc/etc/ssh/etc/ssh/ssh_config/etc/ssh/ssh_config.d/usrecho "what does that package contain?"; rpm -ql openssh-clients | head -6what does that package contain?/etc/ssh/ssh_config/etc/ssh/ssh_config.d/etc/ssh/ssh_config.d/50-redhat.conf/usr/bin/scp/usr/bin/sftp/usr/bin/sshExpected result
dpkg -Lstarts at/.and lists directories as well as files;rpm -qllists paths only, beginning at/etc/ssh/ssh_config.Success conditionYou can list a package's contents on either family and read the difference.
Troubleshooting
dpkg -S /path/to/filereports no package owns a file that plainly exists.Why: The file was not installed by a package - it was created by a script, an installer or by hand - or the path given is a symlink to the real location.
Fix:Resolve the path first with
readlink -f, then query again. On the RPM family the equivalent isrpm -qf <path>, which answers with the full NEVRA.You need the package for a command that is not installed yet, and
dpkg -Scannot find it.Why: dpkg only knows about installed packages. The RPM family's
dnf providessearches the repository metadata instead.Fix:On the RPM family use
dnf provides */<command>. On Debian installapt-file, runapt-file updateonce, thenapt-file search bin/<command>- it is not available by default.dpkg -L <package>output looks like it contains directories that belong to other packages.Why: The listing starts at
/and includes every directory on the path to each file, not only the files the package uniquely owns.Fix:Filter to real files with
dpkg -L <pkg> | xargs -I{} sh -c 'test -f {} && echo {}', or userpm -qlon the RPM family, which behaves the same way.