Linux Operating Systems Fundamentals · Lesson 2

Managing Software and Processes

Managing Software and Processes: Control packages, shared libraries, running processes, priorities, jobs, and signals across major Linux families.

  • linux
  • packages
  • processes
  • lpic-1

Lesson purpose

Administration is safer when you understand both the package database and the live process state. Control packages, shared libraries, running processes, priorities, jobs, and signals across major Linux families.

Learning objectives

  • Manage RPM- and Debian-family software workflows.
  • Trace and maintain shared-library dependencies.
  • Observe, prioritize, control, and troubleshoot processes.

LPIC-1 exam focus

  • 102.3 Manage shared libraries
  • 102.4 Use Debian package management
  • 102.5 Use RPM and YUM package management
  • 103.5 Create, monitor, and kill processes
  • 103.6 Modify process priorities

Teaching sequence

1. Package managers track more than files

The central idea is package managers track more than files. Use these points to explain the topic and connect it to the next command or decision.

  • Application files. The database records installed paths and ownership.
  • Dependencies. Required libraries and packages are resolved before a transaction.
  • Versions. Installed and available releases support upgrades and auditing.
  • Integrity and removal. Checksums, verification, configuration retention, and uninstall policy protect system state.

2. A package filename encodes compatibility

Use this example to show how a package filename encodes compatibility works in a controlled environment.

  • Name. Identifies the software bundle.
  • Version and release. Separate upstream software change from distribution build revision.
  • Architecture. Indicates CPU target or architecture-neutral content.
name-version-release.arch.rpm
name_version-release_arch.deb

Examples:
openssl-3.0.7-28.el9.x86_64.rpm
vim_9.0.1000-1_amd64.deb

3. Local package tools and repositories solve different jobs

This comparison prevents students from treating related tools or layers as interchangeable.

Side Teaching point
rpm and dpkg Inspect or transact directly with a local package file and database.
DNF/YUM, Zypper, and APT Use configured repositories to resolve dependencies, download content, and coordinate upgrades.

Decision rule: Prefer repository-aware tools for routine work; use low-level tools when you intentionally control dependencies.

4. rpm actions install, query, verify, and remove

Use the matrix to contrast the named choices before students select a command or configuration.

Item Meaning
-i / –install Install a package not already present
-U / –upgrade Install or upgrade
-F / –freshen Upgrade only when an older package exists
-q / –query Read package database information
-V / –verify Compare installed files with package metadata
-e / –erase Remove an installed package

Teaching point: Use –test and avoid –nodeps or –force unless you understand the dependency and overwrite consequences.

5. rpm queries answer ownership and dependency questions

Use this example to show how rpm queries answer ownership and dependency questions works in a controlled environment.

  • Package detail. -qi reports version, architecture, source, and description.
  • Files and configuration. -ql lists files; -qc narrows to configuration files.
  • Requirements and providers. -qR lists requirements; –whatprovides identifies the owning package.
$ rpm -qi zsh
$ rpm -ql zsh
$ rpm -qc zsh
$ rpm -qR zsh
$ rpm -qf /usr/bin/zsh

6. Verification distinguishes expected from changed files

Use this example to show how verification distinguishes expected from changed files works in a controlled environment.

  • rpm -V. Compares size, digest, mode, owner, group, timestamp, and other metadata.
  • Configuration marker. A c marker identifies a package configuration file.
  • Repair. Investigate first; a repository reinstall can restore a damaged packaged file.
$ rpm -V package
S.5....T.  /usr/bin/tool
.......T. c /etc/tool.conf
missing    /usr/share/tool/data

7. RPM archives can be inspected without installation

Use this example to show how rpm archives can be inspected without installation works in a controlled environment.

  • rpm2cpio. Converts an RPM payload to a cpio stream.
  • cpio. Lists or extracts files from that stream.
  • Containment. Extract into a temporary directory to avoid overwriting live system paths.
$ rpm2cpio package.rpm > package.cpio
$ cpio -it < package.cpio
$ mkdir inspect && cd inspect
$ cpio -idmv < ../package.cpio

8. Repository tools coordinate complete transactions

Use the matrix to contrast the named choices before students select a command or configuration.

Item Meaning
DNF / YUM Install, remove, update, search, info, provides, clean
Zypper install, remove, update, search, info, refresh, verify
Repository metadata Package availability, dependency graphs, signatures, and updates
Dry-run judgment Review dependency additions, removals, and transaction summaries before approval

Teaching point: Course examples may show YUM; modern RPM-family systems often provide DNF with compatible concepts.

9. dpkg manages local .deb packages and database state

Use the matrix to contrast the named choices before students select a command or configuration.

Item Meaning
-i / –install Install or unpack a local package
-r / –remove Remove program files but retain configuration
-P / –purge Remove package and configuration
-l / -L / -S List packages, list files, or search file ownership
-C / –audit Find partially installed or inconsistent packages

Teaching point: A dpkg dependency error usually calls for an APT repair transaction, not indiscriminate force options.

10. APT separates metadata from transactions

Use the matrix to contrast the named choices before students select a command or configuration.

Item Meaning
apt update Refresh available-package metadata
apt install / remove Resolve and apply a package transaction
apt upgrade Upgrade installed packages within dependency rules
apt-cache search / show Inspect cached repository metadata
apt-get Stable scripting-oriented command surface used in many exam objectives

Teaching point: Update metadata before drawing conclusions about package availability or upgrades.

11. Reconfiguration can repair settings without a purge

Use this example to show how reconfiguration can repair settings without a purge works in a controlled environment.

  • Retained configuration. dpkg -r keeps configuration while dpkg -P purges it.
  • dpkg-reconfigure. Reruns a package’s configuration interface or scripts.
  • Caution. Back up locally modified configuration and understand service impact first.
$ sudo dpkg-reconfigure cups
$ dpkg -L cups
$ dpkg -S /usr/sbin/cupsd

12. Dynamic libraries are resolved at program start

The central idea is dynamic libraries are resolved at program start. Use these points to explain the topic and connect it to the next command or decision.

  • Shared code. Reusable functions are loaded into a process instead of copied into every executable.
  • Search locations. The loader checks configured paths and standard library directories.
  • Cache. ldconfig maintains a fast map of available libraries.
  • Compatibility. Names and symbolic links allow programs to request an appropriate ABI version.

13. Library tools trace the loader’s decision

Use this example to show how library tools trace the loader’s decision works in a controlled environment.

  • ldd. Shows shared objects required by an executable.
  • ldconfig. Refreshes the cache and maintains expected library links.
  • Configuration. LD_LIBRARY_PATH, /etc/ld.so.conf, and /etc/ld.so.conf.d affect search order.
$ ldd /usr/bin/ssh
$ ldconfig -p | grep libssl
$ sudo ldconfig

14. A process is a managed instance of a program

The central idea is a process is a managed instance of a program. Use these points to explain the topic and connect it to the next command or decision.

  • PID and PPID. Identify the process and its parent relationship.
  • Owner. UID and security context determine permissions and signal authority.
  • Resources. CPU, memory, terminal, and start time describe current cost and context.
  • State. Running, sleeping, stopped, and zombie states guide troubleshooting.

15. ps snapshots can be broad or selective

Use this example to show how ps snapshots can be broad or selective works in a controlled environment.

  • Selection. Choose all processes, a user, a terminal, a command, or explicit PIDs.
  • Format. BSD, Unix, and GNU option styles expose different default columns.
  • Interpretation. Read PID, PPID, TTY, state, CPU time, and command together.
$ ps
$ ps aux
$ ps -ef
$ ps -u student
$ ps -p 1234 -o pid,ppid,stat,etime,cmd

16. top connects system load to individual processes

Use this example to show how top connects system load to individual processes works in a controlled environment.

  • System summary. Load average, tasks, CPU, memory, and swap establish context.
  • Process table. Sort and filter by CPU, memory, user, state, or other fields.
  • Interactive control. top can renice or signal a selected process when permissions allow.
$ top
$ uptime
$ free -h

17. Process states explain what the scheduler sees

Use the matrix to contrast the named choices before students select a command or configuration.

Item Meaning
R Running or runnable
S Interruptible sleep while waiting
D Uninterruptible sleep, often I/O
T Stopped or traced
Z Exited child awaiting parent collection
I Idle kernel thread on systems that report it

Teaching point: A zombie consumes a process-table entry, not ongoing CPU; investigate the parent that has not reaped it.

18. Terminal multiplexers preserve work and visibility

This comparison prevents students from treating related tools or layers as interchangeable.

Side Teaching point
screen Uses a Ctrl+A command prefix; supports detach, windows, and split regions.
tmux Uses a Ctrl+B prefix by default; supports sessions, windows, and panes.

Decision rule: A multiplexer keeps terminal programs running after disconnect and lets an administrator observe multiple commands together.

19. Foreground and background are shell relationships

Use this example to show how foreground and background are shell relationships works in a controlled environment.

  • Background start. Append & to start without occupying the terminal foreground.
  • Suspend and resume. Ctrl+Z stops the foreground job; bg continues it in the background.
  • Bring forward. jobs lists shell jobs and fg returns a selected job to the foreground.
$ long_command &
$ jobs
[1]+ Running long_command &
$ fg %1
# Ctrl+Z, then: bg %1

20. nice values influence scheduler priority

Use this example to show how nice values influence scheduler priority works in a controlled environment.

  • nice. Starts a command with an adjusted nice value.
  • renice. Changes the nice value of an existing PID or ownership group.
  • Privilege boundary. Ordinary users may generally lower priority; raising priority requires privilege.
$ nice -n 10 command
$ renice 5 -p 1234
$ ps -o pid,ni,cmd -p 1234

21. Signals request specific process behavior

Use the matrix to contrast the named choices before students select a command or configuration.

Item Meaning
SIGHUP — 1 Hang up; many daemons reload configuration
SIGINT — 2 Interactive interrupt, often Ctrl+C
SIGTERM — 15 Request orderly termination
SIGKILL — 9 Kernel-enforced termination with no cleanup
SIGSTOP / SIGCONT Pause or resume execution

Teaching point: Use the least forceful signal that can achieve the goal, and verify the target PID before sending it.

22. kill tools select targets in different ways

Use this example to show how kill tools select targets in different ways works in a controlled environment.

  • kill. Signals an explicit PID or job.
  • killall. Signals processes by executable name on Linux.
  • pkill. Selects by name plus user and other process attributes.
$ kill -TERM 1234
$ kill -KILL 1234
$ killall process_name
$ pkill -u student process_name

23. Apply the lesson to four scenarios

Ask these questions before revealing the answer key. Require students to name the evidence or command that supports each choice.

  1. A local RPM install reports missing dependencies. Which tool level should handle the routine install?
  2. An executable reports a missing shared object. Which two tools reveal and refresh loader state?
  3. A process ignores SIGTERM and must stop immediately. Which signal is the final escalation?
  4. A long task must survive disconnect and remain observable. Which tool class fits?

24. Connect each scenario to the governing clue

Use these answers to debrief the knowledge check. The explanation matters as much as the label.

  1. Repository-aware RPM tool. Use DNF/YUM or Zypper so dependencies are resolved as one transaction.
  2. ldd and ldconfig. Trace the executable’s requirements, correct configuration, and refresh the library cache.
  3. SIGKILL. Signal 9 is kernel-enforced; use it only after orderly termination fails.
  4. Terminal multiplexer. Run the task in screen or tmux so the session can detach and resume.

25. Three takeaways resolve the lesson

Close the lesson by asking students to restate the decision rule behind each takeaway.

  • Package databases preserve state. Files, versions, dependencies, verification, configuration, and removal policies are linked.
  • Libraries are part of execution. Loader paths, cache, ABI names, ldd, and ldconfig determine whether a program starts.
  • Processes require evidence-based control. Observe PID, owner, state, resources, jobs, priority, and signals before acting.

Next lesson connection: Configuring Hardware.

Classroom application

Use a disposable VM or lab account for commands that can modify packages, processes, partitions, filesystems, ownership, or permissions. Require students to state the target and expected effect before they run a command.

  • Inspect a package before installing it. Compare a low-level package query with a repository-aware dry run and explain how dependency resolution changes the decision.
  • Trace a shared library requirement with ldd, inspect the loader cache, and explain why changing LD_LIBRARY_PATH can help or harm reproducibility.
  • Run a long command in screen or tmux, observe it with ps and top, adjust its priority, and stop it with the least forceful appropriate signal.

Common misconceptions

  • Installing a local package with rpm or dpkg does not provide the same dependency resolution as DNF/YUM, Zypper, or APT.
  • A package database records ownership and dependencies, but it does not make a damaged file safe to ignore. Verify first and repair deliberately.
  • A zombie has exited and is waiting for its parent to collect status. It is not a process consuming ongoing CPU.
  • SIGKILL prevents cleanup. Try SIGTERM first, verify the target, and escalate only when the process will not exit cleanly.

Lesson summary

  • Package databases preserve state. Files, versions, dependencies, verification, configuration, and removal policies are linked.
  • Libraries are part of execution. Loader paths, cache, ABI names, ldd, and ldconfig determine whether a program starts.
  • Processes require evidence-based control. Observe PID, owner, state, resources, jobs, priority, and signals before acting.

The next lesson is Configuring Hardware.