CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
  • Week 1
    • 1.Operating Systems and the Kernel: What Linux Does
    • 2.The Birth of Linux: From Unix to Linus
    • 3.Free Software and Open Source: What a License Decides
    • 4.Distributions: The Unit That Bundles the Kernel and Tools for Sale
    • 5.Week 1 Review: The Identity Behind the Name Linux
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
    • 1.Package Management (1): RPM and YUM
    • 2.Package Management (2): DEB, APT, and Source Installation
    • 3.Device Files and /dev
    • 4.Using Peripherals: Printers · Sound · Scanners
    • 5.Week 7 Comprehensive Review: Packages and Devices
  • Week 8
  • Week 9
  • Week 10
  • Week 11
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← Linux Master 2/Week 7/Day 5

Based on the Linux Master 2 exam syllabus·Report an error

Linux Master 2· AssociateWeek 7 · Day 5~18 min read

Day 5 - Week 7 Comprehensive Review: Packages and Devices

📌 Key Takeaways

  • The RPM family is Red Hat, CentOS, Fedora, SUSE, and the DEB family is Debian, Ubuntu, Mint.
  • Low-level tools (rpm, dpkg) cannot resolve dependencies, and high-level tools (yum, apt) can.
  • apt update refreshes the list, and apt upgrade does the actual update.
  • A block device is b (disk) and a character device is c (keyboard, printer).
  • Three names — CUPS (printer) · ALSA (sound) · SANE (scanner).

Key Points Diagram

   Packages
     RPM family   Red Hat · CentOS · Fedora · SUSE      .rpm
       low-level  rpm   -i install · -U upgrade · -e erase · -q query
       high-level yum → dnf     SUSE uses zypper
       repository /etc/yum.repos.d/
 
     DEB family   Debian · Ubuntu · Mint                .deb
       low-level  dpkg  -i install · -r remove · -P purge · -l list
       high-level apt   update (list) → upgrade (actual)
       repository /etc/apt/sources.list
 
     Source install   tar extract → ./configure → make → make install
     Bundle/compress  tar (-c bundle -x extract -f file) + -z gzip · -j bzip2 · -J xz
 
   Devices
     /dev       b block (disk · USB · CD)   c character (keyboard · printer · terminal)
                major number (driver) · minor number (which one)
     Names      /dev/sda1   sd=SATA · a=first disk · 1=first partition
     udev       auto-creates/deletes /dev files when devices connect/disconnect
     Queries    lsblk · lsusb · lspci · lsmod · dmesg
 
   Peripherals
     Printer  CUPS  Common Unix Printing System   port 631 · cupsd.conf
              BSD  lpr · lpq · lprm
              SysV lp  · lpstat · cancel
     Sound    OSS → ALSA  Advanced Linux Sound Architecture   alsamixer
     Scanner  SANE  Scanner Access Now Easy       scanimage · xsane

Contrasting the Confusing Pairs

ItemABDeciding criterion
RPM vs DEBRed Hat · CentOS · SUSEDebian · Ubuntu · MintDistribution lineage
Low-level vs high-levelrpm · dpkgyum · aptWhether it resolves dependencies
rpm -i vs -UInstall onlyInstalls too if absentHandling of an existing version
dpkg -r vs -PKeeps configDeletes config tooWhether it purges
apt update vs upgradeList onlyActual updateWhat changes
yum vs zypperRed Hat familySUSEBoth RPM but different tool
tar -c vs -xBundleExtractDirection
-z vs -j vs -Jgzipbzip2xz (uppercase)
Block vs character deviceb diskc keyboardWhether random access is possible
Major vs minor numberDriverWhich device—
sda vs sda1The whole diskPartition 1Presence of a number
lpr vs lpq vs lprmPrintCheck queueCancel
OSS vs ALSAOld methodCurrent standardGeneration
CUPS vs SANEPrinterScannerTarget device

Commonly Missed Points

  1. Ubuntu is in the RPM family → No. It is in the Debian family, so it uses .deb.
  2. SUSE is in the DEB family → No. It is in the RPM family, only its tool is zypper.
  3. rpm resolves dependencies for you → It cannot. The high-level tool (yum) does.
  4. apt update upgrades packages → It refreshes the list only.
  5. tar also compresses → It only bundles. Compression needs -z, -j, or -J attached.
  6. Run make install first → The order is ./configure → make → make install.
  7. A printer is a block device → It is a character device. Only the disk family is block.
  8. /dev/sda1 is the whole first disk → The whole disk is /dev/sda, and sda1 is a partition.
  9. CUPS is the scanner → It is the printer. The scanner is SANE.
  10. ALSA is the old one → OSS is the old one, and ALSA is the current standard.

Values That Appear on the Exam as They Are

ValueWhat it is
631CUPS web admin port (IPP standard port)
/etc/cups/cupsd.confCUPS main config file
/etc/yum.repos.d/YUM repository config location
/etc/apt/sources.listAPT repository config file
b / cBlock device / character device marker
/etc/udev/rules.d/udev rule file location
AbbreviationFull name
CUPSCommon Unix Printing System
ALSAAdvanced Linux Sound Architecture
SANEScanner Access Now Easy
OSSOpen Sound System
IPPInternet Printing Protocol

Putting the Four Tools on One Line

Until yesterday we looked at each family separately. The exam mixes the four commands that do the same job into one set of choices, so you need practice reading across.

Taskrpmyumdpkgapt
Install-i file.rpminstall name-i file.debinstall name
Remove-e nameremove name-r nameremove name
Remove including config——-P namepurge name
Installed list-qalist installed-llist --installed
Package info-qi nameinfo name-s nameshow name
List of installed files-ql name—-L name—
Which package owns a file-qf fileprovides file-S file—
Search—search keyword—search keyword
Upgrade everything—update—update then upgrade
  • Reading vertically, there is a rule. The two low-level tools (rpm, dpkg) use hyphen options, and the two high-level tools (yum, apt) use English words. Low-level install takes a file, and the others take a name.
  • Reading horizontally, there are traps. Removal is -e for rpm and -r for dpkg. The list is -qa for rpm and -l for dpkg.

Same Letter, Different Meaning

LetterHereThere
-ldpkg -l — list of installed packagesrpm -ql — list of files inside the package
-Ldpkg -L — list of files inside the packagescanimage -L — list of scanners
-irpm -i · dpkg -i — installrpm -qi — info (after q it means info)
-Pdpkg -P — purgelpr -P — specify printer
-rdpkg -r — removetar -r — append to an archive
-xtar -x — extractlpadmin -x — delete a printer
-dlp -d — the printer to print tolpadmin -d — set the default printer, gzip -d — decompress
updateapt update — list onlyyum update — actual upgrade
  • Option letters are defined separately for each command, so they do not carry over. First look at "which command's option is it", then read the meaning.

Identifying from Just One Line

What is in front of youIdentificationBasis
vsftpd-3.0.2-29.el7.x86_64.rpmRPM family, for the Red Hat 7 line, 64-bitExtension .rpm, el7, x86_64
vsftpd_3.0.5-0ubuntu1_amd64.debDEB family, 64-bitExtension .deb, underscore separators, amd64
backup.tar.bz2Extract with tar -jxvf.bz2 is bzip2 → -j
source.tar.xzExtract with tar -Jxvf.xz → uppercase -J
data.tgzExtract with tar -zxvf.tgz is short for .tar.gz
brw-rw----. 1 root disk 8, 17 …Block device, partition 1 of the second diskLeading b, minor number 16 + 1
crw-rw-rw-. 1 root root 1, 3 …Character device (/dev/null)Leading c
/dev/sdc2Partition 2 of the third diskc = third, 2 = partition
/dev/sr0The first CD/DVD drivesr, numbering from 0
ii apache2 …A properly installed packageii in dpkg -l
rc vsftpd …A package that was removed but whose config remainsrc in dpkg -l → finish removal with dpkg -P
error: Failed dependencies:Install with a low-level tool got blocked by dependenciesInstall with yum or apt

Choosing a Command from a Situation

SituationWhat to chooseConfusing wrong answer
Which package /usr/sbin/sshd came from (Red Hat)rpm -qf /usr/sbin/sshdrpm -ql — the direction is opposite
The same question (Ubuntu)dpkg -S /usr/sbin/sshddpkg -L — the direction is opposite
See the files inside a downloaded .rpm before installingrpm -qpl file.rpmrpm -ql — it only looks at installed ones
Update only what is already installed, and do not install what is absentrpm -Fvh *.rpmrpm -Uvh — it installs if absent
On Ubuntu, remove a package and its config tooapt purge · dpkg -Papt remove · dpkg -r
Only see what is inside a .tar.gztar -ztvftar -zxvf — it actually extracts it
You plugged in a USB and do not know the device nameEnd of dmesg, lsblklsusb — it only tells you whether it is connected
See what chip a network card islspcilsusb — PCI devices do not appear
Print 2 copies to printer hp1 with a System V commandlp -d hp1 -n 2 filelpr -P hp1 -# 2 file — that is the BSD way
Cancel waiting print job 7 with a BSD commandlprm 7lpq — it only displays
Unmute with a single command lineamixer set Master unmutealsamixer — it brings up a screen
See whether a scanner was picked up by SANEscanimage -Llpstat -p — that is for printers

Daemons · Config Files · Ports at a Glance

TargetDaemonConfig locationPort
YUMNone/etc/yum.conf, /etc/yum.repos.d/—
APTNone/etc/apt/sources.list—
Device file managementsystemd-udevd (udev)/etc/udev/rules.d/—
Printing (CUPS)cupsd/etc/cups/cupsd.conf631
Printing (old LPD)lpd/etc/printcap515
Sound (ALSA)None — kernel driver/etc/asound.conf—
Scanner (SANE)saned (only for sharing)/etc/sane.d/6566
  • Among these, the port to memorize as a value is CUPS's 631. Also note that package tools and ALSA are not daemons, so they have no port.
OldNewWhat changed
yumdnfThe next generation of the same RPM family. The command structure is nearly the same
apt-get · apt-cacheaptThe split commands merged into one
devfs · pre-made device filesudevCreates on connection and deletes on removal
/dev/hda (IDE)/dev/sdaDisk naming rule
LPD · LPRngCUPSIPP, web admin page
OSSALSAA Linux-only sound architecture

Connecting It All in One Pass — Attaching a Printer to a New Server

This week's three topics actually connect in one line.

   1  yum install cups              package — the high-level tool installs the dependencies too
   2  rpm -ql cups | grep conf      package — where were the config files installed (/etc/cups/cupsd.conf)
   3  systemctl start cups          start the cupsd daemon
   4  (connect the USB printer)
   5  dmesg | tail                  device — did the kernel recognize it
   6  lsusb                         device — does it show in the USB list
   7  ls -l /dev/usb/lp0            device — the character device file udev made (leading c)
   8  http://localhost:631          peripheral — register the printer on the web page
   9  lpr -P printer1 test.txt      peripheral — print
  10  lpq -P printer1               peripheral — check the queue
  • Steps 1-3 are software installation, 5-7 are device setup, and 8-10 are peripheral use. This is how the two exam-scope items "software installation" and "device setup" interlock.

That wraps up the first subject of the Level 2 exam, Linux Operation and Management. Starting next week we move into the second Level 2 subject, Linux Utilization — X Window, Internet usage, and application areas.

📖 Glossary

  • Dependency: The relationship with other packages that a package needs in order to work.
  • Low-level / high-level tools: A tool that handles a single file / a tool that uses repositories and handles dependencies too.
  • Block device / character device: A device with random access in blocks / a device processed sequentially one character at a time.
  • udev: The system that detects device connection and removal and automatically manages /dev files.
  • CUPS / ALSA / SANE: The standard systems responsible for printers / sound / scanners.
  • Spool: Jobs piled up in the print queue.
  • Repository: The server from which high-level tools fetch packages. yum puts addresses in /etc/yum.repos.d/, and apt in /etc/apt/sources.list.
  • purge: Removing a package along with its config files. dpkg -P, apt purge.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

Which of the following is a Debian-family distribution?

Question 2

Which command extracts a gzip-compressed archive with tar?

Question 3

Which command shows the full list of installed RPM packages?

Question 4

Which character appears at the very start of the ls -l /dev/sda result?

Question 5

Which BSD-family command cancels a print job that is waiting?

Question 6

Which of the following is the sound system currently used as the standard on Linux?

PreviousUsing Peripherals: Printers · Sound · ScannersWeek 7 · Day 4Next The Structure and Evolution of the X Window SystemWeek 8 · Day 1

Official references

  • Linux Master 2 official exam syllabus(opens in a new tab)

On this page

  • Key Takeaways
  • Key Points Diagram
  • Contrasting the Confusing Pairs
  • Commonly Missed Points
  • Values That Appear on the Exam as They Are
  • Putting the Four Tools on One Line
  • Same Letter, Different Meaning
  • Identifying from Just One Line
  • Choosing a Command from a Situation
  • Daemons · Config Files · Ports at a Glance
  • Connecting It All in One Pass — Attaching a Printer to a New Server
  • Glossary
  • Practice Questions