← Linux & the Command Line tutorial

Linux & the Command Line

Package Management

Most Linux distributions install and update software through a package manager rather than downloading installers manually. Debian/Ubuntu-based systems use apt.

Example: installing a web server

$ sudo apt update
$ sudo apt install nginx

sudo runs the command with elevated (administrator) privileges — required for actions like installing software that affect the whole system, not just your own user account. apt update refreshes the list of available package versions before installing anything new — skipping this step is a common habit that leads to installing an outdated version, since your local package list can otherwise be stale. Only after that does apt install nginx actually download and install the web server.

Example
$ sudo apt update
$ sudo apt install nginx
Output
Refreshes the list of available packages, then downloads and installs the nginx web server.