Tools
Linux Package Management & Job Control – Practice Exercises
2025-12-26
0 views
admin
PART 1 — Bash Jobs & Process Control ## Exercise 1 — Job vs Process (Foreground job) ## Exercise 2 — Foreground Job Blocking the Shell ## Exercise 3 — Background Job (&) ## Exercise 4 — Redirect Background Output ## Exercise 5 — Using /dev/null ## Exercise 6 — Job Listing ## Exercise 7 — Bringing Job to Foreground (fg) ## Exercise 8 — Suspending a Job (Ctrl + Z) ## Exercise 9 — Resume Job in Background (bg) ## Exercise 10 — Killing a Job ## Exercise 11 — wait Command ## Exercise 12 — wait -n (any job finishes) ## Exercise 13 — Notification with Terminal Bell ## Exercise 14 — nohup Survival After Logout ## Exercise 15 — Parent Process Change (Re-parenting) ## PART 2 — RPM (Low-Level Package Management) ## Exercise 16 — Inspect RPM Without Installing ## Exercise 17 — Manual RPM Install ## Exercise 18 — RPM Removal ## PART 3 — DNF Core Usage ## Exercise 19 — Search Packages ## Exercise 20 — Install with Dependencies ## Exercise 21 — Remove Package ## Exercise 22 — Repository Awareness ## PART 4 — Repositories (BaseOS, AppStream, EPEL, CRB) ## Exercise 23 — List Repositories ## Exercise 24 — Enable CRB ## Exercise 25 — Enable EPEL ## PART 5 — Dependency Analysis ## Exercise 26 — What a Package Provides ## Exercise 27 — What a Package Requires ## Exercise 28 — Who Requires a Package ## Exercise 29 — Weak Dependencies (Recommends) ## Exercise 30 — Install Without Weak Dependencies ## Exercise 31 — Backward Weak Dependencies (Supplements) ## PART 6 — Dependency Removal Dangers ## Exercise 32 — Dependency Auto-Removal Problem ## Exercise 33 — Fix Using dnf mark install ## PART 7 — Updates, Downgrades, Version Locking ## Exercise 34 — System Upgrade ## Exercise 35 — Downgrade a Package ## Exercise 36 — Temporary Upgrade Exclusion ## PART 8 — Automatic Updates ## Exercise 37 — Enable Automatic Updates ## Exercise 38 — Configure Security-Only Updates ## PART 9 — DNF Modules ## Exercise 39 — List Modules ## Exercise 40 — Enable NodeJS Stream ## Exercise 41 — Install Module Profile ## Exercise 42 — Remove Module Profile ## Exercise 43 — Disable & Reset Module ## PART 10 — Dependency Conflict Debugging ## Exercise 44 — Broken RPM Install ## PART 11 — Snap Packages ## Exercise 45 — Install Snap ## Exercise 46 — Install Firefox via Snap ## Exercise 47 — Compare Versions Goal Understand what a job is vs a process and why pipelines are one job. Try typing another command. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to ? It will become hidden in your post, but will still be visible via the comment's permalink. as well , this person and/or CODE_BLOCK: ping -c 5 google.com | wc -l CODE_BLOCK: ping -c 5 google.com | wc -l CODE_BLOCK: ping -c 5 google.com | wc -l CODE_BLOCK: ping google.com CODE_BLOCK: ping google.com CODE_BLOCK: ping google.com CODE_BLOCK: Ctrl + C CODE_BLOCK: ping -c 10 google.com & CODE_BLOCK: ping -c 10 google.com & CODE_BLOCK: ping -c 10 google.com & CODE_BLOCK: jobs COMMAND_BLOCK: ping -c 10 google.com > ping.log & COMMAND_BLOCK: ping -c 10 google.com > ping.log & COMMAND_BLOCK: ping -c 10 google.com > ping.log & COMMAND_BLOCK: ping google.com > /dev/null & COMMAND_BLOCK: ping google.com > /dev/null & COMMAND_BLOCK: ping google.com > /dev/null & CODE_BLOCK: jobs COMMAND_BLOCK: ping google.com > /dev/null & ping bing.com > /dev/null & COMMAND_BLOCK: ping google.com > /dev/null & ping bing.com > /dev/null & COMMAND_BLOCK: ping google.com > /dev/null & ping bing.com > /dev/null & CODE_BLOCK: fg %1 CODE_BLOCK: Ctrl + C CODE_BLOCK: ping google.com Ctrl + Z jobs CODE_BLOCK: ping google.com Ctrl + Z jobs CODE_BLOCK: ping google.com Ctrl + Z jobs CODE_BLOCK: bg %1 jobs CODE_BLOCK: kill %1 CODE_BLOCK: kill -9 %1 COMMAND_BLOCK: ping -c 5 google.com > /dev/null & ping -c 5 bing.com > /dev/null & wait echo "All jobs finished" COMMAND_BLOCK: ping -c 5 google.com > /dev/null & ping -c 5 bing.com > /dev/null & wait echo "All jobs finished" COMMAND_BLOCK: ping -c 5 google.com > /dev/null & ping -c 5 bing.com > /dev/null & wait echo "All jobs finished" COMMAND_BLOCK: ping -c 10 google.com > /dev/null & ping -c 3 bing.com > /dev/null & wait -n echo "One job finished" COMMAND_BLOCK: ping -c 10 google.com > /dev/null & ping -c 3 bing.com > /dev/null & wait -n echo "One job finished" COMMAND_BLOCK: ping -c 10 google.com > /dev/null & ping -c 3 bing.com > /dev/null & wait -n echo "One job finished" COMMAND_BLOCK: ping -c 5 google.com > /dev/null & wait tput bel echo "Download complete" COMMAND_BLOCK: ping -c 5 google.com > /dev/null & wait tput bel echo "Download complete" COMMAND_BLOCK: ping -c 5 google.com > /dev/null & wait tput bel echo "Download complete" COMMAND_BLOCK: nohup ping -c 30 google.com > nohup.out & exit COMMAND_BLOCK: nohup ping -c 30 google.com > nohup.out & exit COMMAND_BLOCK: nohup ping -c 30 google.com > nohup.out & exit CODE_BLOCK: ps aux | grep ping CODE_BLOCK: ps aux | grep ping CODE_BLOCK: ps aux | grep ping CODE_BLOCK: ps -o pid,ppid,cmd -p <PID> CODE_BLOCK: ps -o pid,ppid,cmd -p <PID> CODE_BLOCK: ps -o pid,ppid,cmd -p <PID> CODE_BLOCK: rpm -qpl zsh*.rpm CODE_BLOCK: rpm -qpl zsh*.rpm CODE_BLOCK: rpm -qpl zsh*.rpm COMMAND_BLOCK: sudo rpm -i zsh*.rpm COMMAND_BLOCK: sudo rpm -i zsh*.rpm COMMAND_BLOCK: sudo rpm -i zsh*.rpm COMMAND_BLOCK: sudo rpm -e zsh COMMAND_BLOCK: sudo rpm -e zsh COMMAND_BLOCK: sudo rpm -e zsh CODE_BLOCK: dnf search links CODE_BLOCK: dnf search links CODE_BLOCK: dnf search links COMMAND_BLOCK: sudo dnf install links COMMAND_BLOCK: sudo dnf install links COMMAND_BLOCK: sudo dnf install links COMMAND_BLOCK: sudo dnf remove links COMMAND_BLOCK: sudo dnf remove links COMMAND_BLOCK: sudo dnf remove links CODE_BLOCK: dnf info neofetch CODE_BLOCK: dnf info neofetch CODE_BLOCK: dnf info neofetch CODE_BLOCK: dnf repolist CODE_BLOCK: dnf repolist CODE_BLOCK: dnf repolist COMMAND_BLOCK: sudo dnf config-manager --set-enabled crb COMMAND_BLOCK: sudo dnf config-manager --set-enabled crb COMMAND_BLOCK: sudo dnf config-manager --set-enabled crb COMMAND_BLOCK: sudo dnf install epel-release COMMAND_BLOCK: sudo dnf install epel-release COMMAND_BLOCK: sudo dnf install epel-release COMMAND_BLOCK: sudo dnf install htop COMMAND_BLOCK: sudo dnf install htop COMMAND_BLOCK: sudo dnf install htop CODE_BLOCK: dnf repoquery --provides bash CODE_BLOCK: dnf repoquery --provides bash CODE_BLOCK: dnf repoquery --provides bash CODE_BLOCK: dnf repoquery --requires bash CODE_BLOCK: dnf repoquery --requires bash CODE_BLOCK: dnf repoquery --requires bash CODE_BLOCK: dnf repoquery --whatrequires bash CODE_BLOCK: dnf repoquery --whatrequires bash CODE_BLOCK: dnf repoquery --whatrequires bash CODE_BLOCK: dnf repoquery --recommends gimp CODE_BLOCK: dnf repoquery --recommends gimp CODE_BLOCK: dnf repoquery --recommends gimp COMMAND_BLOCK: sudo dnf install gimp --setopt=install_weak_deps=False COMMAND_BLOCK: sudo dnf install gimp --setopt=install_weak_deps=False COMMAND_BLOCK: sudo dnf install gimp --setopt=install_weak_deps=False CODE_BLOCK: dnf repoquery --what-supplements langpacks-de CODE_BLOCK: dnf repoquery --what-supplements langpacks-de CODE_BLOCK: dnf repoquery --what-supplements langpacks-de COMMAND_BLOCK: sudo dnf install python3-matplotlib python3 -c "import numpy" sudo dnf remove python3-matplotlib python3 -c "import numpy" COMMAND_BLOCK: sudo dnf install python3-matplotlib python3 -c "import numpy" sudo dnf remove python3-matplotlib python3 -c "import numpy" COMMAND_BLOCK: sudo dnf install python3-matplotlib python3 -c "import numpy" sudo dnf remove python3-matplotlib python3 -c "import numpy" COMMAND_BLOCK: sudo dnf install python3-numpy sudo dnf mark install python3-numpy sudo dnf remove python3-matplotlib COMMAND_BLOCK: sudo dnf install python3-numpy sudo dnf mark install python3-numpy sudo dnf remove python3-matplotlib COMMAND_BLOCK: sudo dnf install python3-numpy sudo dnf mark install python3-numpy sudo dnf remove python3-matplotlib COMMAND_BLOCK: sudo dnf upgrade COMMAND_BLOCK: sudo dnf upgrade COMMAND_BLOCK: sudo dnf upgrade CODE_BLOCK: dnf list python3 --showduplicates sudo dnf downgrade python3-<version> CODE_BLOCK: dnf list python3 --showduplicates sudo dnf downgrade python3-<version> CODE_BLOCK: dnf list python3 --showduplicates sudo dnf downgrade python3-<version> COMMAND_BLOCK: sudo dnf upgrade --exclude=python3* COMMAND_BLOCK: sudo dnf upgrade --exclude=python3* COMMAND_BLOCK: sudo dnf upgrade --exclude=python3* COMMAND_BLOCK: sudo dnf install dnf-automatic sudo systemctl enable --now dnf-automatic.timer COMMAND_BLOCK: sudo dnf install dnf-automatic sudo systemctl enable --now dnf-automatic.timer COMMAND_BLOCK: sudo dnf install dnf-automatic sudo systemctl enable --now dnf-automatic.timer COMMAND_BLOCK: sudo vi /etc/dnf/automatic.conf COMMAND_BLOCK: sudo vi /etc/dnf/automatic.conf COMMAND_BLOCK: sudo vi /etc/dnf/automatic.conf CODE_BLOCK: upgrade_type=security apply_updates=yes CODE_BLOCK: upgrade_type=security apply_updates=yes CODE_BLOCK: upgrade_type=security apply_updates=yes CODE_BLOCK: dnf module list CODE_BLOCK: dnf module list CODE_BLOCK: dnf module list COMMAND_BLOCK: sudo dnf module enable nodejs:18 sudo dnf upgrade node --version COMMAND_BLOCK: sudo dnf module enable nodejs:18 sudo dnf upgrade node --version COMMAND_BLOCK: sudo dnf module enable nodejs:18 sudo dnf upgrade node --version COMMAND_BLOCK: sudo dnf module install nodejs:18/development COMMAND_BLOCK: sudo dnf module install nodejs:18/development COMMAND_BLOCK: sudo dnf module install nodejs:18/development COMMAND_BLOCK: sudo dnf module remove nodejs:18/development COMMAND_BLOCK: sudo dnf module remove nodejs:18/development COMMAND_BLOCK: sudo dnf module remove nodejs:18/development COMMAND_BLOCK: sudo dnf module disable nodejs sudo dnf module reset nodejs COMMAND_BLOCK: sudo dnf module disable nodejs sudo dnf module reset nodejs COMMAND_BLOCK: sudo dnf module disable nodejs sudo dnf module reset nodejs COMMAND_BLOCK: sudo dnf install https://example.com/foreign.rpm COMMAND_BLOCK: sudo dnf install https://example.com/foreign.rpm COMMAND_BLOCK: sudo dnf install https://example.com/foreign.rpm CODE_BLOCK: dnf repoquery --whatprovides <library> CODE_BLOCK: dnf repoquery --whatprovides <library> CODE_BLOCK: dnf repoquery --whatprovides <library> COMMAND_BLOCK: sudo dnf install snapd sudo systemctl enable --now snapd.socket COMMAND_BLOCK: sudo dnf install snapd sudo systemctl enable --now snapd.socket COMMAND_BLOCK: sudo dnf install snapd sudo systemctl enable --now snapd.socket COMMAND_BLOCK: sudo snap install firefox snap run firefox COMMAND_BLOCK: sudo snap install firefox snap run firefox COMMAND_BLOCK: sudo snap install firefox snap run firefox CODE_BLOCK: firefox --version snap run firefox --version CODE_BLOCK: firefox --version snap run firefox --version CODE_BLOCK: firefox --version snap run firefox --version - Two processes (ping, wc) - One job (single command) - Bash job control operates on jobs, not individual processes - Important for debugging pipelines - Shell is blocked - Keyboard input goes to the job - Long-running commands can block automation scripts - Shell returns immediately - Output still appears - Background execution without output control can clutter logs - No terminal noise - Output captured safely - Standard practice for background jobs - Output discarded completely - Useful for health checks, keep-alive scripts - Job IDs ([1], [2]) - Only foreground jobs receive keyboard signals - Job state: Stopped - Job runs again - Still no keyboard input - Safely terminating runaway jobs - echo runs only after jobs finish - Parallel execution control in scripts - Useful in long manual tasks - Job survives logout - Remote server operations - Parent changes to PID 1 after logout - Files installed by package - No dependency resolution - Understand why RPM alone is dangerous in production - Which repository provides it - Missing dependencies - Snap version is newer
toolsutilitiessecurity toolslinuxpackagemanagementcontrolpracticeexercises