Skip to main content

Command Palette

Search for a command to run...

Linux Package & Process Management

Updated
•6 min read•View as Markdown

🎥 Linux Package & Process Management - A Complete Vlog-Style Deep Dive for Beginners & Intermediates 🐧🔥

By Divyanshu Maurya

Hey everyone! 👋
Welcome back to another tech vlog — and today, I’m taking you behind the scenes of Linux.
Not just commands… but why they matter, how they work, and how you should use them like a pro.

Think of this as your complete, detailed, yet beginner-friendly guide to:

✅ Package Management — how Linux installs, updates, and removes software
✅ Process Management — how Linux runs, controls, schedules, and kills processes

Let’s get into it! 🚀


🎬 Part 1 –Package Management in Linux

(The App Store of Your Linux System)

When you install apps on Windows, you double-click an .exe file.
But Linux? Linux uses packages: neatly bundled software + metadata + dependencies.

But the best part?
You don’t download anything manually — the OS does it for you using package managers.

Different distros use different package managers:

DistributionPackage Manager
Ubuntu, DebianAPT
RHEL, CentOSYUM / DNF
FedoraDNF
Arch LinuxPacman
openSUSEZypper

Let’s cover them one by one (with detailed explanations + commands + examples).


🟦 APT (Advanced Package Tool) — Ubuntu/Debian

APT is the most widely used package manager because Ubuntu dominates the Linux desktop world.

APT works with .deb packages and uses repositories stored in /etc/apt/sources.list.


🔹 APT — Essential Commands (Explained in Depth)

1️⃣ Update Package List

sudo apt update

✔ Fetches the latest package information
✔ Syncs your system with repository metadata
✘ Does NOT install or upgrade anything

Think of it as refreshing your Play Store.


2️⃣ Upgrade Installed Packages

sudo apt upgrade

✔ Downloads + installs newest versions
✔ Keeps old configuration files
✔ Does NOT remove old packages


3️⃣ Install a Package

sudo apt install package_name

✔ Automatically installs dependencies
✔ Downloads from repository
✔ Installs only trusted, signed packages

Example:

sudo apt install curl

4️⃣ Remove a Package

sudo apt remove package_name

✔ Removes installed program
✘ Keeps configuration files (inside /etc/)

To remove config files:

sudo apt purge package_name

5️⃣ Remove Unused Dependencies

sudo apt autoremove

✔ Removes libraries installed as dependencies
✔ Helps free disk space


6️⃣ Search for a Package

apt search package_name

7️⃣ Show Full Package Information

apt show package_name

Shows:
✔ Version
✔ Size
✔ Dependencies
✔ Maintainer
✔ Description


🟧 YUM & DNF — For RHEL, CentOS, Fedora

Older systems use YUM, newer ones use DNF.

DNF = faster, has better dependency resolution, and supports parallel downloads.


🔹 YUM — Key Commands

sudo yum check-update
sudo yum update
sudo yum install package_name
sudo yum remove package_name
yum search package_name
yum info package_name

🔹 DNF — Key Commands

sudo dnf check-update
sudo dnf upgrade
sudo dnf install wget
sudo dnf remove wget
dnf search wget
dnf info wget

💡 Why DNF is better than YUM?

  • Faster dependency resolution

  • Parallel downloads

  • Better memory handling

  • Plugin support

  • Cleaner output


🟨 Pacman — Arch Linux

Arch users love speed and minimalism — and Pacman is built exactly for that.

Pacman uses .pkg.tar.zst packages and its commands are short, clean, fast.


🔹 Pacman — Essential Commands

Update + Upgrade

sudo pacman -Syu

Install Package

sudo pacman -S package_name

Remove Package

sudo pacman -R package_name

Search Package

pacman -Ss package_name

Show Info

pacman -Si package_name

🟩 Zypper — openSUSE

Zypper is super powerful and offers advanced repo handling.


🔹 Zypper — Key Commands

Refresh Repositories

sudo zypper refresh

Update Everything

sudo zypper update

Install

sudo zypper install git

Remove

sudo zypper remove git
zypper search git

Info

zypper info git

🎉 Package Manager Summary (Vlog POV)

Each distro has its own style, but they ALL help you:

  • Update software

  • Install/remove apps

  • Manage dependencies

  • Maintain system stability

If you master these, you can work on any Linux server like a pro! 💪


🎬 Part 2 – Process Management in Linux

(The Heartbeat of Your Operating System)

A process is a running program.
Every app—browser, terminal, editor—becomes a process when it runs.

Processes have:

  • PID (Process ID)

  • State (running, sleeping, stopped)

  • Priority

  • Resources (CPU, RAM)

  • Owner (user)

Let’s go deeper.


🔹 Types of Processes

1️⃣ Foreground Process

Runs in the terminal → blocks input
Example:

ping google.com

2️⃣ Background Process

Runs behind the scenes
Example:

ping google.com &

🔹 Process States Explained

StateMeaning
RunningCurrently executing or ready to run
SleepingWaiting for input/output
StoppedSuspended (Ctrl + Z)
ZombieFinished but waiting for parent cleanup

Zombie = dead but not removed — they don’t consume CPU.


🛠 Commands to View Processes


1️⃣ ps

ps aux

Shows ALL processes with:

  • CPU usage

  • RAM usage

  • Owner

  • PID

  • Command


2️⃣ top

Live process monitoring.

Shows:

  • Load average

  • CPU usage

  • RAM usage

  • Per-process stats


3️⃣ htop (More user-friendly)

sudo apt install htop
htop

✔ Color-coded
✔ Easy sorting
✔ Tree view of processes


4️⃣ pgrep

pgrep -l firefox

Find PIDs by name.


🔧 Controlling Processes

Background job:

command &

Foreground:

fg %1

Background:

bg %1

🔥 Killing Processes

By PID:

kill 1234

Force kill:

kill -9 1234

Kill by name:

pkill firefox
killall firefox

🎚 Priority Management: nice & renice

Linux uses a nice value (-20 to 19):

  • -20 → highest priority

  • 19 → lowest priority

Start process with priority:

nice -n -5 command

Change priority of an existing process:

renice -n 10 -p 4567

🧠 Advanced Process Debugging

1️⃣ Trace syscalls → strace

strace -p PID

2️⃣ See open files → lsof

lsof -p PID

3️⃣ Stack trace → pstack

pstack PID

4️⃣ Debug using gdb

gdb -p PID

💡 Real-World Example: Managing Apache Web Server

Start in background:

sudo apache2ctl start &

Check running processes:

ps aux | grep apache2

Monitor CPU/memory:

top -p $(pgrep -d',' apache2)

Increase priority:

sudo renice -n -10 -p $(pgrep apache2)

Trace errors:

sudo strace -p $(pgrep -o apache2)

🏁 Final Take (Vlog Ending)

In today’s deep-dive vlog, we learned:

🎯 Package Management

  • How to install, update, remove software

  • How different distros handle packages

  • APT vs YUM vs DNF vs Pacman vs Zypper

🎯 Process Management

  • Types of processes

  • Foreground vs background

  • Monitoring tools (ps, top, htop)

  • Killing processes safely

  • Managing priority

  • Advanced debugging (strace, lsof, gdb)

If you understand these two concepts, you’ve mastered the core of Linux system administration.