Skip to main content
Before we move on to installing NGINX, it’s important to understand package managers. A package manager is an automation tool that handles installing, upgrading, configuring, and removing software on your system. It downloads packages, resolves and installs dependencies, and integrates software with your OS configuration. Using a package manager makes software installation predictable, repeatable, and secure compared to manual installs — which is why we use them to install NGINX.
A slide titled "Package Manager" showing three colorful boxes labeled "Downloading software," "Sorting out dependencies," and "Managing everything in the system," each with an icon. An orange tools icon sits above the boxes inside a dashed rounded rectangle.
How it works
  • The package manager contacts one or more repositories (maintained by the OS vendor, third parties, or the open-source community) to fetch packages and metadata.
  • When you request an install, the manager checks dependency metadata and installs any required packages automatically.
  • It may run configuration or post-install scripts to integrate the software with system services.
  • From fetching packages to resolving dependencies and running configuration tasks, the package manager automates the full software lifecycle.
Popular package managers (summary) First up: apt (Advanced Package Tool)
  • Used on Debian-based systems (including Ubuntu).
  • Works with .deb packages and maintains a package index for fast lookups.
  • Common commands:
    • Update package index: sudo apt update
    • Install a package: sudo apt install package_name
    • Remove a package: sudo apt remove package_name
    • Upgrade installed packages: sudo apt upgrade
    • Search packages: sudo apt-cache search package_name
A presentation slide titled "Popular Package Managers" featuring "The Advanced Package Tool (APT)". It notes APT is used for Debian-based systems (like Ubuntu) and works with .deb packages.
Next: YUM (Yellowdog Updater, Modified) and DNF
  • Common on Red Hat–based distributions (RHEL, CentOS, older Fedora). Newer Fedora and RHEL/CentOS versions use DNF (dnf) which is largely compatible with YUM commands.
  • Works with RPM packages and resolves dependencies automatically.
  • Common commands:
    • Update packages and metadata: sudo yum update (or sudo dnf update)
    • Install a package: sudo yum install package_name (or sudo dnf install package_name)
    • Remove a package: sudo yum remove package_name
    • Search for a package: sudo yum search package_name
A presentation slide titled "Popular Package Managers" showing a highlighted badge for "Yellowdog Updater Modified (YUM)". A bullet notes it is used for Red Hat–based systems (like CentOS and Fedora).
Next: Homebrew (macOS and Linux)
  • Popular on macOS and also available on Linux as brew.
  • Installs into a user-writable prefix (for example /usr/local on Intel macs or /opt/homebrew on Apple Silicon), so most installs do not require sudo.
  • Common commands:
    • Update Homebrew: brew update
    • Install a package: brew install nginx
    • Uninstall a package: brew uninstall package_name
    • Search packages: brew search package_name
A presentation slide titled "Popular Package Managers" highlighting Homebrew. It notes Homebrew is used for macOS and installs software into the home directory without requiring sudo privileges.
On Windows: Chocolatey
  • Command-line package manager for Windows that wraps installers and handles dependency scripts.
  • Common commands:
    • Install a package: choco install package_name
    • Uninstall a package: choco uninstall package_name
Note: sudo apt update refreshes the package index and does not accept -y. To automatically accept prompts on Debian/Ubuntu, use -y with apt install or apt upgrade (for example, sudo apt install -y nginx). Similarly, use the auto-confirm flags for other package managers when performing non-interactive installs (e.g., -y for yum, dnf, and choco).
Consolidated command examples
  • Replace package_name with the package you want (for our purpose: nginx).
Summary
  • Always prefer your platform’s package manager to install NGINX (or other software). Package managers handle dependency resolution, updates, and clean removal in a consistent way.
  • Next: a demo that shows step-by-step installation and basic configuration of NGINX using the package manager appropriate for your OS.
Links and references

Watch Video